The keto-enol tautomeric shift occurs under acidic or basic conditions:
In acidic conditions, the keto form is protonated, and a subsequent rearrangement leads to the formation of the enol.
Under basic conditions, a hydroxide ion abstracts a proton from the alpha-carbon, generating an enolate that can then tautomerize to the enol.