Strictly, biochemically speaking, fermentation is the extraction of energy from carbohydrates in an anaerobic environment.
In the context of food, usually it's more about the production of alcohol or acid rather than the energy thing (but that's important too - you sometimes have to deal with the excess heat).