Fermentation is basically glycolysis which produces a net of two ATP. If there is no oxygen available pyruvate the end product of glycolysis is converted to lactic acid or ethanol depending on species.
Two ATP is not much compared to the extra 32 that could be produced by the rest of the energy extraction process, the Krebs cycle and oxidative phosphorylation, but it's not as hopeless as it looks because glycolysis happens 100 times faster.