The main purpose of pain is to be a protective mechanism for the body. Pain occurs whenever a tissue is being damaged and causes the individual to react such that the pain stimulus is removed. The detection of pain is mediated through pain receptors.
All pain receptors are free nerve endings.
Pain receptors are widespread in the superficial layers of the skin, as well as internal tissues such as the periosteum, the arterial walls, joint surfaces, and the tissues of the cranial vault. Also, on a larger scale, the main stimulus for pain receptors is tissue damage. Tissue damage, in turn, can be initiated by heat, chemicals such as bradykinin, an increase in potassium concentration, and proteolytic degradation of nerve endings. Most commonly, tissue ischemia occurs where the blood flow to the organ is blocked. The greater the metabolic rate of the tissue, the greater is the lactic acid concentration, and there is faster onset of pain.