Your brain is going to decide that staying to nurse your sprained ankle will reduce your overall probability of survival, so it shuts the pain off. How does it do that?
1) Your brain decides that pain is going to reduce your survival rate, so it tells the hypothalamus, “Let’s not have any pain.”
2) The hypothalamus communicates with the Peri-Aqueductal Gray Matter (PAGM), which is the gray matter surrounding the cerebral aqueduct in the midbrain. The PAGM coordinates the body’s analgesic system. (When the PAGM is electrically stimulated, pain is shown to be eliminated or reduced).
3) When the PAGM is activated, it sends analgesic impulses down through the brainstem, through the raphe nucleus, which synapses with a descending neuron that goes down one side of the spinal cord (dorsolateral tract) to influence analgesia at the appropriate level of the spinal cord.
As previously described in earlier posts, a nociceptive impulse comes into the dorsal horn of the spinal cord and synapses with a second order neuron to go in the spinothalamic tract to the brain for pain to be recognised/registered.
If it is inappropriate to feel pain, analgesic impulses come down the dorsolateral tract, and at the appropriate level of the spinal cord, a neuron (analgesic neuron) will project from the dorsolateral tract into the area of the synapse between the axon of the sensory neuron and the start of the second order neuron (which would take the nociceptive impulse to the brain).
So, when it is not appropriate for you to feel pain in order to ensure your survival , your body activates its own analgesic system, releasing its own opioids, blocking off pain. All this happens outside your awareness.
This is your amazing body.