Milk naturally contains a sugar called lactose. In room temperature, any bacteria present in milk can convert this lactose into lactic acid through fermentation. Lactic acid is responsible for the flavor of sour milk while also causing it to thicken, coagulating into curds. This reaction is harnessed to create yoghurts and cheeses.  The acid can also build up in the muscles during strenuous exercise, with its acidity damaging the tissue to cause the stinging feeling that occurs when muscles are overexerted.