Long answer from google:
The sour taste of sourdough bread comes from organic acids produced by wild bacteria and yeast living in the
Sourdough starter during fermentation. [
1,
2]
As these microbes consume the sugars in the flour, they create two primary acids that shape the flavor:
- Lactic Acid: Produces a smooth, mild, yogurt-like tang.
- Acetic Acid: Produces a sharper, more pungent, vinegary bite. [1, 2]
Bakers can adjust how sour the bread tastes by changing factors like dough temperature, hydration, and rising time (such as cold-fermenting the dough in the refrigerator to build up more acetic acid).