Nucleophilic Substitution at Carbonyls
The question this page answers: What happens in tetrahedral intermediates that have potential leaving groups?
Deeper reading: Clayden 2e: Chapter 10 Page 197–221, Chapter 11 Page 222–238, Chapter 23 Page 528–534 — see our chapter-by-chapter practice map for Clayden.
The tetrahedral intermediate
What would the tetrahedral intermediate do?
When a nucleophile is added to a carbonyl, a tetrahedral intermediate is formed.
When evaluating the outcome of a reaction, the central question is, what would the tetrahedral intermediate do? In some cases, such as in nucleophilic addition to a ketone under basic conditions, the intermediate can collapse back to the starting materials:

Leaving groups and intermediate collapse
What makes the intermediate collapse?
However, if there is a leaving group (LG) attached to the carbonyl C, then it is possible for the tetrahedral intermediate to collapse:

The better the leaving group is, the more unstable the tetrahedral intermediate is, and the more unstable the tetrahedral intermediate is the more likely it is to collapse.
Good leaving groups are generally weak bases:

Therefore, acid chlorides are more susceptible to substitution than anhydrides and ester.
The outcome of substitution
What does the outcome of substitution depend on?
The outcome of substitution of carbonyl-containing FGs with nucleophiles depends on
- the reaction conditions (acid vs base),
- stability of the tetrahedral intermediate, and
- reactivity of intermediate carbonyls formed upon collapse of tetrahedral intermediates.
In some cases, the equilibrium between carbonyls and tetrahedral intermediates is interrupted by an irreversible step:

In other cases, after collapsing the tetrahedral intermediate, the carbonyl-containing FG is more reactive than the initial reactant:

Creating more reactive carbonyls
How are carboxylic acids made more reactive?
To create more reactive carbonyls, a common approach is to first transform carboxylic acids into acid anhydrides or acid chlorides.
Reacting a carboxylic acid with an acid chloride, or another anhydride, leads to the formation of acid anhydrides:

Reacting a carboxylic acid with halogenation reagents such as thionyl chloride (SOCl2) or PCl5 leads to acid chlorides. These reactions work by converting the OH into a better LG that is substituted by a chloride:

Imines and enamines
How do amines turn carbonyls into imines or enamines?
In some cases, the carbonyl O is converted into a LG (often H2O) and then leaves the molecule
When primary amines react with ketones or aldehydes under acidic conditions, imines are formed. Imines are more reactive than carbonyls once protonated, and will easily react with water under acidic conditions to convert into carbonyls:

When secondary amines react with ketones or aldehydes with an alpha-H, an intermediate iminium ion is formed, which then converts into an enamine.

Spotted an error, or want a topic covered next? Let us know.