Yeast is familiar to us for a few reasons, the most appetizing being their critical role in making beer, wine, and bread. At some point, people discovered this cute little trick that yeast does. It eats sugar, shits alcohol, and farts COtwo. (Did I say this was appetizing?)
Yeast is in the air. Many moons ago, probably somewhere in Egypt or Mesopotamia, someone mixed ground wheat with water to bake over a fire. The paste was left out for a while, and when it came time to bake, they found the dough was like twice the size it was before. Yeast farts. When you bake the dough after yeast has done its thing, you get a lighter, spongy-er bread that’s pretty tasty.
The yeast/gas action is known as leavening, a word most of us were probably first exposed to in its negative form: unleavened bread. The Jews use unleavened bread for their Passover celebration. Maybe it was because of those Egyption bastards who had enslaved them. Leavening was probably all the rage along the Nile, and the Jews were like, look at those assholes with their asshole bread all ballooned out and stupid looking. What assholes. Hence, unleavened bread for the Passover.
You can do this today. Mix a cup of flour and a cup of water together in a container and let it sit in the open air for a few hours. Then put a loose-fitting lid on the container, let it sit for a few days, and watch what happens. It starts bubbling. This is COtwo. You have enslaved yeast to build your pyramids of French bread.
Now, it’s kind of hard to do this in Indiana. Some places are famous for the ease with which you can capture yeast out of the air and create a sourdough culture. San Francisco is one of these places. The Midwest is not. I’ve tried to do this several times, and have only been successful once.
[There are also people who think the "yeast in the air" theory is bullshit, and that the yeast is actually already in the flour when you mix it with water. I prefer the airborne yeast theory because it is demonstrably cooler.]
The recipe I used that worked (can't find it at the moment, but there are a bunch online, along with this great article on the topic) called for pineapple juice. This is supposed to create the optimal environment for yeast to survive in your petri dish. Specifically, it produces an acidic environment, which is good for yeast and apparently bad for bacteria. That’s what’s happening in your container there, a battle between yeast and bacteria, and you want the yeast to win. But there’ll always be a little bacteria in your starter, as you keep this bubbling goo going for years and years.
After 3 days or so, you start “feeding” the thing, which means you add equal parts water and flour and stir it up. You’re adding food (sugar) for the yeast to keep them alive, but as I said, some bacteria will stick around in small amounts. The buggers just won’t go away, and that’s what gives the sour flavor to sourdough bread.