Muscle cramps happen when anaerobic respiration takes place in our muscle cells.
When we are doing heavy physical work/exercise then there is a lack of oxygen as demanded by the muscles cause this.
Explanation:
The below figure explains the flow of conversion of glucose to energy -
When the Pyruvate converted into lactic acid instead of CO2 + Energy + H2O
Muscle cramps occur.
A hot water bath or a massage can help in getting relief from muscle cramps. These two things improve blood circulation, thereby increasing the supply of oxygen to the muscles.
Hence, after doing physical work we get muscle cramps are due to the conversion of pyruvate to lactic acid.