If you've ever had some procedure done at the doctor's office (major or minor) you've probably been exposed to anesthesia.
For minor procedures like tooth filling or a skin biopsy, the physician likely administered a local anesthetic that block specific nerves from transmitting pain information to the brain. However, for any major surgery that are complex and require deep cuts into the body, surgeons work with general anesthesiologists to make sure the patient is well unconscious.
General anesthesia is often administered through inhalation of gaseous anesthetic agents. This includes nitrous oxide, and other forms of ether (isoflurane, sevoflurane, and desflurane). These gases act on the entire nervous system, dampening the brain's ability to perceive or remember pain during the procedure. However, like local anesthetics, the sensation of pain will likely return once the anesthesia wears off.
Researchers are still trying to understand exactly how anesthesia affects neurotransmitters in the brain. Furthermore, the high complexities involved with putting a patient under is why there's a dedicated team of doctors and nurses to support this process.
For now, many patients just glad to have the option of going under instead of being awake during an operation. I know I am!