Lactic acid fermentation
As in yogurt, when the acidity rises due to lactic acid-fermenting organisms, many other pathogenic microorganisms are killed. The bacteria produce lactic acid, as well as simple alcohols and other hydrocarbons. These may then combine to form esters, contributing to the unique flavor of sauerkraut.