There are different types of anesthesia, but to understand any of them, you need the same information.What we feel as pain starts out just like any other sensation. It gets picked up by receptors, and then a signal is sent to the brain. Along the way, the signal travels by a system of nerve cells, also called neurons. Within a neuron, the signal travels by a sort of biological electricity.
To get from one neuron to the next, it travels by a chemical signal. A neuron makes a chemical called a neurotransmitter (can you see how they got that name?). The next cell in line picks up the chemical in receptors. The neurotransmitters don't enter the cell; they just tell the cell to send the signal on down the line. The chemical is then broken down by enzymes and the pieces are recycled by the cell that made the neurotransmitter.
Each tiny area of your body has its own connection to the brain, so that if a message is sent on a particular nerve pathway, the brain interprets that as a sensation from that place in your body.
Most anesthetics work on the nerve-to-nerve part of the system. They may stop the neurotransmitter from getting out of the cell, so no signal is sent. Or they may block the receptors so that no matter how much neurotransmitter is around, the next cell never gets the message. Or they may break down the neurotransmitter faster. All of these actions will stop the signal from getting from the receptor to the brain.
Sometimes, we can be injured without feeling pain. The brain has no pain receptors, so when they do brain surgery, they can just use a local anesthetic to stop the feeling of pain in the scalp, but leave the patient awake. Sometimes we can feel pain without being injured. If neurotransmitters get released along a pain circuit, our brain thinks we have been hurt. People who have had a limb amputated sometimes feel "phantom" pain in the limb that is gone. For example, they may feel pain in their foot even though they no longer have a foot.
Some people are born without the ability to feel pain. This may seem like a good thing at first, but why might this be a real problem? Thanks for asking.