If you've ever had to prepare for a race or any other intense workout, chances are you’ve suffered from the debilitating power of muscle cramps. These contractions forcefully squeeze all the little nerve endings inside the muscle to cause what feels like a lifetime of pain, but what is their exact cause? In Life Noggin’s video, “What Causes Cramps?” host Patrick Graziosi explains muscle cramps are triggered by the onset of muscle spasms, which are the involuntary contractions of one or more muscles.

There are many theories for why we get these cramps. Previously, it was believed electrolyte loss and dehydration were at the root of these aches. A 2010 study published in the journal Sports Health proposed you’re more susceptible to cramps when you exercise, as the body begins to sweat, releasing water and electrolytes like sodium, potassium, magnesium, calcium, and chloride. The researchers believe it’s during this release that the body starts to become depleted, causing the nerve impulses from the brain to become deranged and produce these cramps.

However, the main theory as to what causes cramps involves the muscle’s hyperexcitability. When you’re working out very intensely or keeping a certain muscle in a particular position for a long time, it may become fatigued. A muscle’s reflex control becomes dysfunctional, and rather than contracting and relaxing as usual, it begins to fire away or get “twitchy” and can’t stop contracting, according to a 2009 study published in the British Journal of Sports Medicine. In this process, there are signals being sent between the muscle to the central nervous system in the spine, which tell it to either relax or contract.

These cramps are most common in the foot and calf muscles, along with the front and the back of the thigh, the hands, arms, abdomen, and the muscles along the rib cage. As seen in the video above and below, these contractions can be hard, tight, and extremely painful.

Muscle cramps should be avoided by everyone, especially athletes. Those who train harder than their training experience are more likely to experience cramps than those who stay within their endurance limits. Drinking water can also contribute to preventing and alleviating cramps.

Remember: Always breathe, stretch, shake, and let it go before rigorous activity.