Aldehydes and ketones are somewhat lycanthropic chemical species. Take acetone. It behaves as a garden-variety polar aprotic solvent, which makes it a useful medium for SN2 reactions; it reacts readily with nucleophiles like enolates, Grignards, and amines; and is several pKa units less acidic than alcohols (~20 vs. 16). This chemical behavior reflects the fact that it spends the vast majority of its time as a ketone, with an electrophilic carbonyl carbon. It’s nice and stable. You use it to wash glassware with, or as paint thinner.
But every couple of blue moons (for acetone in water about 1/6600 th of the time at 23 °C) acetone undergoes a transformation to its alter ego, the enol form. [EDIT: equilibrium constant is 1 x 10^-8 in water) And as its name suggests, the enol form – which is an isomer, not a resonance form – has the characteristics of both alkenes and alcohols: it can involve itself in hydrogen bonding via the OH group, it is acidic at oxygen, and it reacts with electrophiles (like aldehydes, for example, in the Aldol reaction). In short, the enol form differs from the keto form in its polarity, acidity, and nucleophilicity just like werewolves differ from ordinary folks in their copious body hair, nocturnal rambunctiousness, and peculiar dietary habits.
The reason for the equilibrium lying to the left is due to bond energies. The keto form has a C–H, C–C, and C=O bond whereas the enol has a C=C, C–O an O–H bond. The sum of the first three is about 359 kcal/mol (1500 kJ/mol) and the second three is 347 kcal/mol (1452 kJ/mol). The keto form is therefore more thermodynamically stable by 12 kcal/mol (48 kJ/mol).
Although the keto form is most stable for aldehydes and ketones in most situations, there are several factors that will shift the equilibrium toward the enol form. The same factors that stabilize alkenes or alcohols will also stabilize the enol form. There are two strong factors and three subtle factors.
1. Aromaticity. Phenols can theoretically exist in their keto forms, but the enol form is greatly favored due to aromatic stabilization.
2. Hydrogen Bonding. Nearby hydrogen bond acceptors stabilize the enol form. When a Lewis basic group is nearby, the enol form is stabilized by internal hydrogen bonding.
Here are three more subtle effects in keto-enol tautomerism:
3. Solvent. Solvent can also play an important role in the relative stability of the enol form. For example, in benzene, the enol form of 2,4-pentanedione predominates in a 94:6 ratio over the keto form, whereas the numbers almost reverse completely in water. What’s going on? In a polar protic solvent like water, the lone pairs will be involved in hydrogen bonding with the solvent, making them less available to hydrogen bond with the enol form.
4. Conjugation . π systems are a little like Cheerios in milk: given the choice, they want to connect together than hang out in isolation. So in the molecule depicted, the more favorable tautomer will be the one on the left, where the double bond is a connected by conjugation to the phenyl.
5. Substitution. In the absence of steric factors, increasing substitution at carbon will stabilize the enol form. Enols are alkenes too – so any factors that stabilize alkenes, will stabilize enols as well. All else being equal, double bonds increase in thermodynamic stability as substitution is increased. So in the above example, the enol on the left should be the more stable one. As you might suspect, “all things being equal” sounds like a big caveat. It is – all else is rarely equal. But that’s a topic for another day – or, more likely, another course.
Sources: “March’s Advanced Organic Chemistry”, “Solvents and solvent effects in Organic Chemistry”, by Christian Riechart. EDIT: Commenter Natalia helpfully points out that Carey & Sundberg A is a great resource for this topic (section 7.3 in my 4th edition) and she is right.