During strenuous activities such as exercising, the consumption of oxygen is greater than it's supply. As Oxygen is the final acceptor of electrons in the electron transport chain, without Oxygen the chain comes to a stop and ATP cannot be produced through aerobic means.
During the production of pyruvate in glycolysis NAD is reduced and ATP alsoaproduced. As Humans only have a finite amount of NAD, the reduced NAD must be oxidised in order to keep accepting electrons during glycolysis. This is achieved by reduced NAD reducing pyruvate, which produces lactic acid and reforms the NAD. The NAD reformation allows ATP to keep being prodcued in glycolysis anaerobically.