All systems, procedures and mechanisms throughout the body function to one ultimate goal; provide for and protect the brain at all cost. It may seem strange, selfish even from a certain stand point, but after extensive thought and research I believe it is so. Proof of this can be found when studying the behavior of the body during starvation. At a certain point of desperation, the brain authorizes the destruction of specific systems in the body that would otherwise perform their own harmless functions, but who now must be called upon to provide for the brain, with consequence to them self, where the normal systems have failed. For example, the muscle systems being digested to meet the brains high energy demand.
This does raise some questions about life in general but those are philosophical questions for another time. The point remains however that the brain's foremost priority would be to protect it self and all the services that administer to it from damage. It is interesting to note that the brain itself cannot perceive pain so it must rely on systems outside itself for notification of imminent and currently active danger, this is were pain comes in.
Pain works quite simply, when any thing happens to the body that will be either immediately or eventually damaging, the body sends a signal saying what area is being damaged, what (to a certain degree) is causing the damage, and how severe it is or can become.(Haven't you noticed that although a pinched spinal cord is not as gruesome as a gash along the back of the leg, it hurts much more; it has more potential to be life threatening as far as the brain is concerned.)
In most cases the signal bypasses the brain at first and the spinal cord takes the necessary actions (signaling various muscles) to stop the damage; that's a reflex. If it is prolonged however, the brain steps in to take control of the situation. Pain is a very contrary sensation, so chances are, when we feel it we will act to stop it. So we sustain as little damage as possible. Just imagine what would happen to you if the first time you felt a little pain today it had instead been non-existent. Suppose your shower water had been way too hot this morning and the instant you stepped in, your back flared in pain and you stepped out. If that sensation of burning had not been present, by the time you left the shower, your back would be raw, contaminated with dirty suds and on its way towards serious infection. We would die in a very short amount of time with out this defense system. Fortunately every system in the body except the brain itself is equipped with this security precaution. We have to listen to our body when it tells us something because it's for our own good.
For that reason generic pain killers actually can be dangerous sometime if we don't take an intelligent assessment of the pain we are feeling first; it could be the beginning of something serious.
I would never wish away pain unless I wished way the ever present reasons for having it as well.