Milk sours when the lactobacillus bacteria it contains consumes the lactose sugar in it to produce lactic acid. This causes the protein casein to turn to curd.
Lactobacillus is a harmless bacteria in milk. When milk is pasteurized, it kills off both the harmful bacteria and most of the lactobacillus, which helps the milk last longer in the refrigerator. Because of the curdling process caused by the lactose acid on the milk protein casein, farmers can produce other dairy products such as cheese, keifer, and yogurt. Lactobacillus produces lactose acid as a by-product of turning the lactose sugar into energy.