Why does yogurt taste sour?

The sour taste in yogurt is a result of the lactic acid produced by bacteria during the fermentation process. When milk is exposed to bacteria, the bacteria consume the lactose (a sugar found in milk) and convert it into lactic acid. The increase in lactic acid content gives yogurt its characteristic tangy flavor and lowers the pH level of the milk. This process is what gives yogurt its unique flavor and texture. The lactic acid also acts as a preservative and contributes to the yogurt's extended shelf life.