Long story short, sourdough was / is how bread was made throughout history. Fermentation takes a very long time due to the nature of the levain. At some point, bakers noticed how the leftovers from brewers yeasts drastically shorten fermentation. That and industrialization led to modern day bread you find in the supermarket.
Jon from Proof Bread on YT does a much better job at explaining. [1]
Another great watch is Michael Pollan's "Cooked" series. In the 3rd episode, he explores bread, it's history and makes the case about modern industrialization affecting the quality and the nutritional value of modern bread. [2]
[1] https://www.youtube.com/watch?v=h-0p0p0zqVE [2] https://www.youtube.com/watch?v=epMAq5WYJk4