An enol and an enolate are both nucleophilic at the α carbon, and a halogen molecule — Br2, Cl2, I2 — is a perfectly good electrophile, so the halogen ends up on the α carbon. Acid and base both promote this, because both generate the nucleophile, but they do not give the same product. Acid stops after one halogen; base keeps going for as long as the halogenated α carbon still has a hydrogen on it. The reason is a single substituent effect read in two directions.
Acid: through the enol, and it stops
Under acid the substrate tautomerizes to its enol, and enol formation is the slow step. The enol's C=C attacks the halogen, expelling halide, and loss of the OH proton gives the α-halo carbonyl. Halogen is consumed only as fast as enol is made.
The product then resists a second round. Making an enol requires protonating the carbonyl oxygen, and the newly installed halogen is strongly electron-withdrawing, so the carbonyl is less basic and harder to protonate. The second enol forms more slowly than the first, so monohalogenation is controllable.
Base: through the enolate, and it runs away
Under base the substrate is deprotonated to its enolate, which attacks the halogen directly. Now the same electron withdrawal works the other way: the halogen stabilizes the next enolate's charge, so the remaining α hydrogens are more acidic than the ones you started with and the second deprotonation is faster than the first. Each halogenation accelerates the next, and the reaction does not stop cleanly at one. The limit is the α carbon itself, not the base: isopropyl phenyl ketone, whose single α carbon carries one hydrogen, is monohalogenated under base however much halogen you use, because after one substitution there is nothing left to remove.
The haloform reaction
Runaway halogenation is useful when you want it. Take a methyl ketone, CH3COR, and treat it with excess halogen and excess hydroxide: all three methyl hydrogens are replaced, giving CX3COR. That CX3 is now a workable leaving group, because the carbanion departing with the electrons is stabilized by three halogens. Hydroxide adds to the carbonyl and the tetrahedral intermediate collapses, expelling −CX3 — ordinary nucleophilic acyl substitution with an unusual leaving group. Products: the carboxylate (the acid after acidic workup) and CHX3, the haloform.
With I2 the byproduct is iodoform, CHI3, a yellow precipitate with a distinctive medicinal smell, which makes the reaction a classical test. A positive iodoform test indicates a methyl ketone — also acetaldehyde, and any alcohol the alkaline hypoiodite oxidizes to one first: ethanol and any secondary alcohol CH3–CH(OH)–R. The test reports the CH3CO or CH3CH(OH) fragment, not the ketone as such.
Hell–Volhard–Zelinsky: halogenating an acid
A carboxylic acid will not do any of this: its hydroxyl oxygen is already donating into the carbonyl, and the acid has essentially no enol to work with. The fix is a derivative that does enolize.
Br2 with a catalytic amount of PBr3 — or red phosphorus, which makes PBr3 in situ — converts the acid to the acyl bromide, which enolizes readily. That enol brominates at the α carbon, and the resulting α-bromo acyl bromide exchanges with more starting acid, releasing the α-bromo acid and regenerating an acyl bromide to carry the cycle on.
The product matters because an α-bromo acid is an SN2 substrate. Displace the bromide with NH3 (used in excess) and you have an α-amino acid; displace it with hydroxide or water and you have an α-hydroxy acid. This is a classical laboratory route to the α-amino acids — Strecker and the Gabriel–malonic ester sequence are others — and it gives them racemic.
The α-halo ketone itself
An α-halo ketone is a good electrophile in its own right. The position α to a carbonyl is activated toward SN2, so these are unusually reactive alkylating agents, and base eliminates HX to give an α,β-unsaturated ketone — the same enone the aldol condensation reaches by another road.