The children's website Kidshealth gives a gentle introduction.
The two pain relievers kids take most often are ibuprofen (say: i-byoo-pro-fen) and acetaminophen (say: uh-see-tuh-mi-nuh-fen). They come in liquid or pill form. You swallow them, and the pain soon goes away or hurts less.
[...]
Your body is full of nerve endings in your skin and tissues. Some of these nerve endings can sense pain, like from a burn or a blow to a body part (like your friend's foot hitting your shin). When cells in your body are injured or damaged, they release a chemical called prostaglandin (say: prass-tuh-glan-din).
The special nerve endings that sense pain are very sensitive to this chemical. When prostaglandin is released, the nerve endings respond to it by picking up and transmitting the pain and injury messages through the nervous system to the brain. They tell the brain everything about the pain, like where it is and how much it hurts. The brain then responds: Yow!
Pain is painful, but it isn't all bad. It's your body's early warning system that something is wrong, so you can take steps to correct the problem. For example, if you couldn't feel pain, and you had your hand on a hot stove, you wouldn't know your hand was burning. Because of pain, your brain gets the message to get your hand off the stove right away!
When you take a pain reliever like ibuprofen, it keeps injured or damaged cells from making and releasing prostaglandin. When the cells don't release this chemical, it means that the brain won't get the pain message as quickly or clearly. So your pain goes away or becomes less severe for as long as the cells aren't releasing the chemical. Acetaminophen works in the brain so you don't feel the pain.
If you ever have an operation or another health problem that causes a lot of pain, doctors may prescribe pain relievers that are stronger than acetaminophen and ibuprofen. These types of pain relievers work by getting in between the nerve cells so they can't transmit the pain message to one another. The message isn't able to make it to the brain, and this keeps the person from feeling pain.
Some other links