Regardless of whether you are making wine, beer, vodka or ethanol for your gas tank, the basic chemistry of fermentation is still the same. In fermentation, microorganisms called yeast consume sugars and other carbohydrates for energy, creating alcohol as a byproduct. What really separates one form of alcoholic beverage from another is how much alcohol is present and what else is in the liquid.
Wine Making: Primary Fermentation
After grapes are crushed to make wine, they are typically tested for factors like acidity and sugar, and then left out for a day. On the second day, yeast is added. In some places where wine making has been a local industry for several hundred years or more, the yeasts already naturally present in the air are exactly the type desired by the winemaker, and therefore little if any needs to be added. In regions where this is not the case, sulfites must be added to kill undesired yeasts. This is all done in a fermentation vat, often exposed to the open air.
Wine Making: Secondary Fermentation
The result of primary fermentation is called "new wine." It is a half-baked alcohol with certain charms, but not really wine yet. The new wine is transferred from its fermentation vat to aging casks (traditionally oak, but also stainless steel, and even glass for home winemakers). This is done when the sugar and acidity have reached the desired levels, and because the microorganisms that will turn wine into vinegar thrive in the open air. By confining the wine to a container with minimal air, those vinegar-making bugs will be killed off. The transfer to closed containers allows fermentation to continue, creating real wine instead of vinegar.