There are multiple good resources online about pain mechanisms and management. I encourage you to watch some of the following videos:
Understanding pain video - the brain receives peripheral information and creates the sensation of pain
Chronic pain video by Daniel Clauw MD
Pain and the brain by Sean Mackey, MD, PD
Pain is a very important protective feature of the human body. Without pain we would be in great danger. Actually, there are people who cannot feel pain at all, one condition is called congenital insensitivity to pain. You can read stories about some of these people with congenital insensitivity to pain: NY Times link and ABC news link. It is very unlikely we will ever have a pill to take all of the pain away due to the protective role of pain.