Lactic acidosis occurs when there is an imbalance between the production and removal of lactic acid. This can result from various conditions, such as severe exercise, hypoxia (lack of oxygen), liver dysfunction, or certain diseases like sepsis. Medications, including metformin, can also elevate lactic acid levels, especially in individuals with predisposing factors.