Vinegar is a sour liquid made by a family of aerobic bacteria called Acetobacter. Acetobacter form acetic acid by metabolizing ethanol, a fermentation byproduct. Given a source of fermentable sugar, both fermentation and the conversion of the resulting ethanol to acetic acid will occur without human intervention. The word vinegar comes from the French vin aigre, or sour wine.
The production of vinegar is ancient -- the Egyptians were producing it 5,000 years ago. Both the Bible and the Qur'an mention vinegar. In the 19th century, Louis Pasteur laid the groundwork for modern vinegar production when he explained how wine turns to vinegar.
Almost any source of alcohol can be turned into vinegar. Beer, wine, fruits, apple cider, coconuts and rice can all be fermented and converted. Some common types of commercial vinegar are Malt vinegar (from beer), apple cider vinegar, wine vinegar (this can be red, white, Sherry, Champagne, or other types), and distilled vinegar (typically made from corn-based 190 proof ethanol).
In unpasteurized vinegars, a jelly-like mass of acetobacter and cellulose called mother of vinegar can form. This can either be left alone, strained out, or used to start a batch of homemade vinegar.
One special type of vinegar is balsamic vinegar, that has been made in the Italian province of Emilia-Romagna for a thousand years. True balsamic vinegar is made from the cooked down must (juice) of Trebbiano grapes that is aged for at least 12 years in a rack of multiple barrels of different woods and different sizes, typically cherry, chestnut, acacia, mulberry, ash, juniper and oak. Over the lengthy aging period in this solera-type system, the mosto cotto (cooked must) is transformed into vinegar, which is strongly flavored by the barrels and concentrated by evaporation. Some balsamic vinegars can be 100 years old, though 12, 18 and 25 are more common. True balsamic vinegar (called Aceto Balsamico Tradizionale) is nearly black, opaque, and has an intense sweet-sour aroma and flavor. Used by the drop, it is a garnish for cheeses, fresh fruit, and ice cream. True balsamic vinegar has DOP (protected origin) status and is expensive, with 18 year old balsamics running hundreds of dollars for 100 ml.
Less expensive balsamic vinegar lacks DOP status. These are typically called Balsamic Vinegar of Modena, and can be simply wine vinegar flavored and colored, or true balsamic that is not made in the right place, or aged for less time than legally required. These can be cooked down to about half their volume at home to concentrate them.
Most vinegar is diluted to between 4 and 8% acetic acid, though "spirit vinegar" is sold for pickling purposes that typically contains more acetic acid. Highly concentrated acetic acid (sometimes known as glacial acetic acid) can cause severe chemical burns and should never be ingested. Distilled vinegar can be used as an effecting cleaning agent.
Vinegar is also commonly flavored with herbs such as tarragon, citrus fruit, oregano, or thyme. Vinegar is also used in cocktails to make shrubs, which are cooked down vinegar with flavorings and sugar.