Bacteria such as Lactobacillus ferment lactose (milk sugar) to lactic acid.
This acid lowers the pH and causes the milk proteins (mainly casein) to coagulate, resulting in curdling.
\[
\text{Lactose} \xrightarrow{\text{bacteria}} \text{Lactic acid}
\]