Why does milk turn sour?
Milk contains many bacteria which are not harmful for human beings. One of which gives milk sweet characteristic and the other gives it sour characteristic sweet one works more efficiently under the cold condition and sour one works more efficiently in warm conditions. When the milk is warm the bacteria causing sweetness is overpowered by the bacteria causing sourness resulting in the sour taste of milk. Milk contains bacteria called lactic acid which changes the taste of milk and makes it sour.
To prevent the milk getting sour when it is sent to the bottling company they pasteurize the milk in which most part of this bacteria is destroyed and makes it suitable to store and drink. If the milk will not be pasteurized then it will turn sour many times faster than the pasteurized milk. These bacteria are not completely killed in this process so the bacteria which are left will gradually reproduce and may turn the milk sour but not so easily and early as the pasteurized milk.
If these bacteria were not present in the milk then we would not be able to get buttermilk, sour cream, cheese.
Bacteria in the milk start to reproduce and forms gases and chemicals which change its smell, taste, texture. Same happens when flour come in contact with yeast and water which forms bread.