I've always been kind of fascinated by the way ancient cultures were able to create leavened bread when it seems like culturing wild yeast is a non-obvious thing to do, particularly for a society that predates knowledge of of microorganisms. Did they have any explanation for why a sourdough starter worked? Would they have thought it was a supernatural process?
I'm going to respond to this in a slightly roundabout manner because the practical methods of food preparation are important to refine the question.
Ancient cultures did not directly create a sourdough starter in the same sense that we do today. We tend to create a sourdough starter by combining a very refined and finely ground flour with pure water and then exposing it to some sort of yeast and bacteria. We do this because we typically want to make dough only on certain days or because we want to take advantage of chemical leavening using ingredients to offset the acid in a starter to make a quickbread.
They typically just only baked a portion of their dough each day. Every day, they would simply add new ingredients to their sponge (dough) and allow it to proof (typically overnight). Then they would cut and shape and bench proof and bake.
Speaking from the perspective of a baker, it's rolling the dice as to the nature of the starter you will create if you follow any of the methods that don't involve seeking out a known culture. Multiple wild yeast strains might be in play, as might various strains of bacteria that produce lactic acid and acetic acid. Very few of combinations of these organisms will produce something that is consistent and desirable, let alone unique enough to be worth using over a known culture. If you are lucky enough to start a unique and consistent culture, it is typically worth propagating it and passing it to others simply because the event is so rare.
Where did the known cultures come from originally? We have evidence of ones saved and passed on for generations, which puts their origin well before the advent of modern laboratory techniques. The best theory that I have seen for the origin was that they were a product of the proximity of multiple human activities occurring in a settlement. Bread making close to beer and wine making close to pickling close to production of less well known products like kefir and kombucha.
Most vegetables have bacteria capable of producing lactic acid growing on them. In the case of whole pickling, it evolved from storage practices where fresh goods were left in crocks and vats with salt water. The salt moderates the growth of undesirable bacteria and allows bacteria that can survive the conditions in crocks kept year to year to continue to grow while killing off ones that would cause undesirable results. In the case of some products like sauerkraut, there is enough desirable bacteria present that you can at any time start your own culture with raw cabbage and a suitable environment.
Most of the current commercially available strains of yeast are propagated by companies that were founded primarily to produce alcohol (Fleischmans, Red Star). This is because yeast foam is a mostly undesirable byproduct of any fermenting grain mash that has to be skimmed to maintain sanitary conditions. As these companies grew and new resources became available to them, they started laboratories to research, classify, cultivate and otherwise control their yeast strains. To make them consistent.
Consistency is a very important thing in any sort of cooking or baking. That's why we have recipes. That's why we save cultures and techniques and try to create resources and pass them on. This discussion of the controversy surrounding beer or bread being produced first in ancient times frames things much better than I am capable.
The human beings that survived to adulthood in ancient times did so by being consistent and taking minimal risks. I can't easily cite evidence of what they thought was happening, be it spirits or gods partially because that evidence did not survive or is open to interpretation because it happened before written records were in existence. I can continue to provide evidence of how they did things by examining how we do things. If someone else has good examples of how ancient cultures did things, I would appreciate learning about them.