It's your body's survival mechanism kicking in. With an attitude like this, of course, you'd never ride out of your driveway. But you keep going because you want to challenge yourself. Some pain, it seems, is good for us. The human body does poorly in a stress-free environment.
Humans seem to seek out an optimal level of stress.
It's a very reinforcing process. So, given that you're not going to turn around and head for the nearest Tastee Freeze at the first sign of pain, you have to deal with it. Typically, this means trying to ignore it. Trouble is, many researchers say, this is the worst thing you can do if you want to go fast. It's called disassociation and it actually can make you slower.