system
Given the following post, respond as if you're commenting on Reddit:
human
Eli5: Why do we feel muscle spasms sometimes when we stay in the same position for an extended period of time but not when we're sleeping?
gpt
You don't stay in the same position when you sleep. It may seem that way, but your body constantly shifts its weight off of pressure points throughout the night. This is why people who are found down from strokes or opioid overdoses often have massive pressure ulcers after several hours, but you've never developed a pressure ulcer from sleeping -- even if you're sleeping on a hard surface. 

As for muscle spasms, those can be the result of odd positioning (strange tension on a muscle group) or any number of electrolyte abnormalities. Usually it's low potassium, but even dehydration can bring about spasms. You experience these in your sleep as well, but since you're asleep you don't notice. The one major exception to this is the so-called charlie horse in your calves, which tends to DEFINITELY wake people up.