We've examined the nucleophilic addition to aldehydes and ketones. The carbonyl carbon of aldehdyes and ketones are electrophilic. With aldehydes and ketones, R' and R" are either H or C containing groups and since H:- or R:- are poor leaving groups aldehydes/ketones undergo nucleophilic addition. Remember when we talked about how reactive (unstable) carbanions and hydride anions are? They are very unstable meaning that they don't like to have negative charges on them (carbon and H are very electronegative). They are terrible leaving groups, so they only do an addition.
The structures of carboxylic acid derivatives are quite different in that they have a leaving group (LG). Recall that a leaving group gains electrons (charge) when it leaves. Good leaving groups are those species that can handle (stabilize) this charge. A neutral leaving group becomes negative when it leaves. A positively charged leaving group becomes neutral. A positively charged leaving group is better than neutral leaving (same atom only) since there is no charge on a positive leaving group after it has left. Because of this leaving group carboxylic acid derivatives under nucleophilic acyl substitution.
With acid halides, the leaving group is a halogen that becomes a halide ion. Halogens are excellent leaving groups. (e.g. Cl are excellent leaving groups since Cl- ion likes having a negative charge (completes octet and high electronegativity).
Anhydrides have carboxyl leaving groups. Carboxyl groups are also good leaving groups as they are stabilized by resonance.
With esters, the leaving group is an alkoxide or alcohol (neutral leaving group). Not as good a leaving group as a carboxyl but better than an amide/amine.
In amides, the leaving groups are amides or amines (neutral leaving group). In general, these are the worst leaving groups of the carboxylic acid derivatives. The hydrolysis of amides typically require heating.
Thus considering the nature of these leaving groups the following reactivity order would be expected.