Further, as many above have pointed out, beer was not necessarily fermented wildly. Much in the same way the ancients carried out some fairly sophisticated selection among crops without understanding molecular genetics, they also carried out some fairly sophisticated yeast selection without understanding microbiology. Folks used the "magic" stick, or they used the same fermenting pot that made a good batch. They may have innoculated wort with krausen from a "good" brewer or with some of the unfiltered beer from a good batch. They weren't just setting the wort out somewhere and praying for the best. They were working at it.
Oh yeah, I forgot all about the magic stick.....That was an early form of yeast ranching.