How does "preemptive analgesia" work? My doctor used this on me during a recent
discectomy. I had very little pain afterwards.

Preemptive analgesia is a way to inject a numbing painkiller into the epidural space around the spinal cord. The patient must be lying face down for this operation. The injection is given at least 20 minutes before the first incision.

It works by allowing local pain killing agents to lock onto the spinal nerve roots. The nerve roots normally signal the spinal cord. The spinal cord then signals the brain about
any problems. However the nervous system is very plastic or changeable. This means that pain signals can get blown out of proportion, leaving the patient with much more pain than is warranted by the condition. Once the signal gets turned on, it's hard to turn it off.

Doctors can "preempt" severe pain by attaching a local anesthetic to the spinal nerves before pain signals ever get started. The patient still has some pain as a protective mechanism, but not the intense, prolonged pain allowed by central nervous system plasticity.