Pain is a complicated sensation that depends not only on the severity of the actual injury, but on factors such as physical health and personal experiences and expectations. If you go to the dentist to have a filling, your fear of the drill and anticipation of the discomfort it will produce is likely to increase the level of pain you actually feel.
Your body contains nerve endings that are sensitive to painful stimuli such as crushing, extreme temperatures and irritating chemicals. When part of your body is injured, for example jamming your finger in a door, the nerve endings transmit pain signals to the brain via the spinal cord. Electrical signals and chemical messengers carry the information to various parts of the brain where they are interpreted as pain or not depending on the immediate requirements of the situation.
It is possible for you to be unaware of pain, as particular conditions need to be met before the pain signals affect your conscious mind. For example, a soldier in battle may not notice any pain from an injury until the immediate threat has vanished.