system
Given the following post, respond as if you're commenting on Reddit:
human
What is a cramp?

I understand that cramps are caused by electrolyte deficiency, and the pain comes from overshortening, but how does a muscle overshorten? What roles do electrolytes play in muscle activity?
gpt
short answer: your muscles require energy (ATP) to release not to contract, and that energy controls the flow of ions in and out of the muscle tissue.  Thus with an ion defficiency, your muscles can contract all they want but can't release in a timely manner, thus causing the cramp.

this also explains rigor mortis.