Imagine you have two glasses of wine in front of you. Each was made from grapes grown on the same vines, but 10 years apart. The glass on the left is young, smells like ripe berries, and when you take a sip it fills your mouth with tart bitterness. You swallow, and your mouth feels dry and slightly chalky. The glass on your right smells like earth and leather. The fruitiness is still there, but its taste is more subtle, and mixed with chocolate, licorice, and leather. You swallow, and your mouth feels fuzzy and warm. The flavors taper off slowly.

Even if you are a novice wine-taster, a properly aged wine will taste and feel very different from the younger version. Why is it that some wines taste better as they get older while others get worse? And perhaps most important, how in the world do you tell them apart before it's too late?

A bottle of wine might look like a closed system, but inside there are complex chemical transformations that scientists are still unraveling. However, there is wide agreement that the most critical factor in the aging of wine are tannins.

Tannins are a group of molecules that come from grape stems, seeds, and skins. "Tannins are present in all grapes and are generally produced by the plant as defensive compounds," said Jim Kennedy, an enologist at California State University, Fresno. Tannins have anti-fungal properties, but also make the unripe grape taste really nasty until the seed is mature. Not only do they taste bitter, tannins bind to the proteins that make your saliva slimy, stripping away the sliminess, leaving your mouth feeling dry, chalky, and ashen. "This is like how a green banana leaves your mouth feeling," Kennedy said. This feeling is called astringency.

But tannins aren't just salivary spoil sports. They're also indirectly responsible for a wine's smell. Tannins don't have any aromas themselves, but react with the wine's alcohols and esters (acidic alcohols) to gradually subdue the flowery, fruity aromas of youth. They also combine with other molecules to help create the more complex and subtle smells characteristic of mature wines.

Small amounts of oxygen leaking in through the cap react with the tannins, helping prod along its chemical transformations with other molecules. But, if that oxygen comes in too quickly, it will overwhelm the tannins and oxidize the other molecules, causing the wine to taste skunky (similar to how an exposed apple turns brown). The wine's acids are preservatives, and help buffer against this rapid oxidation, giving tannins time to neutralize individual oxygen molecules.

Coping with unruly oxygen molecules alters tannins, says Kennedy, which affects the way the wine will eventually feel in your mouth. Instead of binding with salivary proteins and leaving your mouth dry, mature tannins (along with those maturely scented molecules they're bound to) linger pleasantly on your gums, cheeks, and tongue. (If you're interested, Wineanorak.com has a full scientific breakdown of what scientists currently know about tannins.)

The winemaker determines the amount of tannins that go into the wine, primarily by controlling how long the mashed grapes stay in contact with the tannin-loaded stems, skins, and seeds. Wine that's allowed to marinate at length in the grape detritus will start out as a bitter, dry youngster, and mature into a rich, complex, and highly desirable vintage. Wines that age well do so over a continuum, and there is an ideal period where the flavors of both youth and maturity are balanced. "You will have a little bit of youthful fruitiness and some of the bottle bouquet," says Andrew Waterhouse, an enologist at UC Davis. Opening a bottle when it's at this peak is highly desirable, but hard to do.

Tannins also affect the color of the wine. "The bluish-red color of a young wine is all due to pigments in the grape," Kennedy said. "Those initial plant derived compounds go away after a couple of years." They are gradually replaced by deeper, brick-red colors created as long polymer chains that link the grape pigments to the tannins.

Most wines that age well are reds (their color comes from the long exposure to skin, stems, and seeds), but only certain grapes have the right balance of sugars, acids, and tannins to support a long aging period. Typically, these tend to be grapes grown in places with long, warm summers and cool, but not frosty, winters. California's Napa Valley, or France's Bordeaux region are both known for wines that age well. Some of the more popular grape varietals for aging are Cabernets, Merlots, and Malbecs, Waterhouse says.

But even checking the label for a certain region or type of grape won't give you a perfect prediction of the wine's shelf life. Kennedy says the best way to ensure your wine will age well is to consult either your local wine shop, or your snooty, know-it-all cousin. While you're at it, invest in a refrigerator that will keep your aging bottles at an even 55 degrees F, as too much heat will cause the wine to oxidize.

The best aged wines start out as brash, thin-skinned grapes, get some character by wallowing in boozy detritus, and finally develop depth and maturity in their later years that people will appreciate. Which brings me to the most important thing I've learned about wine: Before you start obsessing over wine, make sure your friends and family will tolerate your inevitable inclination to turn everything into a wine metaphor.