flour already contains different kinds of yeast and bacteria spores. when flour comes in contact with water, the enzyme amylase breaks down the starch into different sugars. the yeast which is part of sourdough, can use these sugars. the mixture will develop into a stable bacteria culture, which will use fermentation. the yeast will produce carbon dioxide as a by-product of fermentation, which will leaven the dough.