Solution (source code)

= Solution

An <enolate> is an <ambident nucleophile>: the negative charge is concentrated toward <oxygen>, while its occupied conjugated orbital also has substantial reactive amplitude at the alpha <carbon>. An alkyl <iodide> presents an accessible, polarizable <carbon> <electrophile>. <carbon> attack through an <SN2 reaction> is generally kinetically favorable, while the more strongly charged <oxygen> is often coordinated to the <counterion> or solvated. The <carbonyl> reforms as the new C–C bond is made.
$$
\mathrm{R{-}C(O^-){=}CHR'+MeI}\longrightarrow\mathrm{R{-}C(O){-}CH(Me)R'+I^-}.
$$
\b[<carbon> alkylation restores the <carbonyl> and makes the new C–C bond.] <oxygen> alkylation instead gives an enol <ether>. The two outcomes are not resonance contributors of one product, and their ratio is not determined just by where the largest formal negative charge is drawn. <electrophile>, <counterion>, solvent and aggregation can change selectivity; hard <silicon> <electrophiles> and suitable acylating reagents often favor <oxygen> trapping. Product stability alone would not explain an irreversible kinetic choice.