If we let yogurt sit for more days, the yogurt becomes more and more sour. Why does that happen?
Lactic acid is produced by 'probiotic' bacteria breaking lactose into lactic acid. Over time, more lactose is converted, producing more byproducts, thus more sourness.
The byproducts of this reaction are responsible for the distinctive flavor of yogurt.
See a more complete description here: Lactic Acid Fermentation
Yogurt is sour because of the process of fermentation, whereby lactose bacteria make energy by breaking down lactose to glucose and galactose. Glucose then enter glycolysis to produce energy in a form of ATP and NADH, and lactic acid is produced as a by-product (waste product). The production of lactic acid makes the pH of the milk to drop, from approximately 6 to 4 and it is this lactic acid that makes yogurt sour.