Endorphins are among the brain chemicals known as neurotransmitters, which function to transmit electrical signals within the nervous system. At least 20 types of endorphins have been demonstrated in humans. Endorphins can be found in the pituitary gland, in other parts of the brain, or distributed throughout the nervous system.
Stress and pain are the two most common factors leading to the release of endorphins. Endorphins interact with the opiate receptors in the brain to reduce our perception of pain and act similarly to drugs such as morphine and codeine. In contrast to the opiate drugs, however, activation of the opiate receptors by the body’s endorphins does not lead to addiction or dependence.
Source: www.ncbi.nlm.nih.gov