Fermentation is an ancient practice originating before we knew that gut micro-floral health was even a thing. Humans have used fermentation to produce drinks and beverages since the Neolithc age in preserving foods and producing alcoholic beverages. You may also have felt its affects of fermentation after exertion when oxygen-starved muscle cells collect lactic acid from lactic acid fermentation.
Zymology (the science of fermentation)
As a metabolic process fermentation began billions of years ago, before our planet had such an oxygen-rich atmosphere. It is the primary way that micro-organisms extract energy from organic nutrients in the absence of oxygen; by consuming sugars and transferring them to organic acids, gases, or alcohol.
Fermentation gives rise to carbon dioxide; this is captured by ethanol manufacturers and used to prepare dry-ice for use in other industrial applications.