|MadSci Network: Neuroscience|
The body most likely produces endorphins during exercise because the body doesn't realize that you are just "exercising." Think of it this way, if you were running away from an enemy (or predator or any type of danger), would you really want to know how much your muscles (or sprains or strains or even broken things) hurt? No, it would be a distraction to the task at hand, namely survival. So, the body produces endorphins (the natural opiates) which dampen down the pain inputs. Today, of course, you are likely to be running to lose a few pounds or for a race or because you enjoy it, but as you work out, your body doesn't necessarily know why the activity levels are what they are ... it is just monitoring the levels.
You might find a couple interesting things at:
Try the links in the MadSci Library for more information on Neuroscience.