When we run or perform heavy exercise we run out of oxygen as our heart beats at a very fast rate to produce oxygen.When the body runs out of oxygen,the body produces lactic acid which acts as a substitute for oxygen. Excessive production of lactic acid results in muscle cramps. Hope this helped.