Esterification of a carboxylic acid:
The mechanism that is displayed is other example of nucleophilic substitution. In the first step, the carbonyl oxygen creates a bond to the acidic proton. This results in the carbonyl oxygen acquiring a positive charge. This creates the carbonyl carbon more electrophilic and activates it to react with the weakly nucleophilic alcohol. In the 2nd step, the alcohol employs a lone pair of electrons to make a bond to the carbonyl carbon. At similar time, the carbonyl π bond breaks and both electrons move onto the carbonyl oxygen to make a lone pair of electrons and so neutralize the positive charge. Activation of the carbonyl group is significant because the incoming alcohol gains a not favorable positive charge throughout this step. In the third stage, a proton is transferred from the original alcohol portion to the OH group that we want to remove. By doing this, the latter moiety becomes a much better leaving group. In place of a hydroxide ion, we can now remove a neutral water molecule. This is acquired in the fourth step where the carbonyl π bond is again formed and the water molecule is expelled.
Figure: Esterification of a carboxylic acid.