Many of the same kinds of nucleophiles that add to aldehyde and ketone carbonyls will attack the carbonyl of an acid (acyl) derivative like an acid chloride, and yield substitution products. This substitution occurs in two steps, rather than a direct SN2, because:
Just like nucleophilic addition, nucleophilic acyl substitution comes in two flavors:
Uncatalyzed
Whereas the majority of these reactions will occur for all leaving groups with all nucleophiles, the reaction represented by the last nucleophile (the Claisen condensation) only occurs with esters.
Acid-Catalyzed
Catalysis by toluenesulfonic acid is shown, but a drop of sulfuric acid works well also. Just as in the nucleophilic addition case, protonation enhances the polarization of the p* orbital toward carbon.
Claisen condensation occurs only with esters.