This concept can be better understood using an example.
Ethylacetoacetate (Acetoaceticester) gives a positive test for ketones and esters; this is not surprising because the structure as shown below has both functional groups.
In addition it gives a purple color with ferric chloride, this is surprising. Because only phenols and enols are known to give such a positive result. This cannot be explained on the basis of the structure shown above. After extensive investigations it was concluded that ethylacetoacetate actually exists as an equilibrium mixture of two different molecules as shown below
The second structure has an enol group responsible for the purple color with ferric chloride.
Thus ethylacetoacetate exists as a mixture of keto and enol forms in equilibrium with each other. At ordinary temperatures the keto form is almost 99% (because of its greater stability).
Generally many aldehydes and ketones can exist in these two forms. The percentage of enol form is usually insignificant. There are some compounds wherein the enol form can be high because of its greater stability as in the case of acetylacetone.
The enol form has greater stability than expected because of intramolecular hydrogen bonding to a 6 membered cyclic transition state.