Lactic acid fermentation
The main method of producing yogurt is through the lactic acid fermentation of milk with harmless bacteria. Most often, the bacteria  used are Lactobacillus bulgaricus and Streptococcus thermophilus, and United States as well as European law requires all yogurts to contain these two cultures (though others may be added as probiotic cultures). These bacteria produce lactic acid in the milk culture, decreasing its pH and causing it to congeal. The bacteria also produce compounds that give yogurt its distinctive flavor. An additional effect of the lowered pH is the incompatibility of the acidic environment with many other types of harmful bacteria.