Among the brain's many jobs is to be your own chemist. The brain produces more than 50 identified active drugs. Some of these are associated with memory, others with intelligence, still others are sedatives. Endorphin is the brain's painkiller, and it is 3 times more potent than morphine.
http://www.angelfire.com/hi/TheSeer/seratonin.html