Acyl chlorides (also known as acid chlorides) are one of a number of types of compounds known as "acid derivatives". This is ethanoic acid:
If you remove the -OH group and replace it by a -Cl, you have produced an acyl chloride.
This molecule is known as ethanoyl chloride and for the rest of this topic will be taken as typical of acyl chlorides in general. Acyl chlorides are extremely reactive. They are open to attack by nucleophiles - with the overall result being a replacement of the chlorine by something else.
A nucleophile is a species (an ion or a molecule) which is strongly attracted to a region of positive charge in something else.Nucleophiles are either fully negative ions, or else have a strongly \(\delta^-\) charge somewhere on a molecule. The nucleophiles that we shall be looking at all depend on lone pairs on either an oxygen atom or a nitrogen atom.
Nucleophiles based on oxygen atoms
We shall be talking about water and alcohols, taking ethanol as a typical alcohol.
Notice how similar these two molecules are around the oxygen atom. That's what turns out to be important.
Nucleophiles based on nitrogen atoms
We shall be considering ammonia and primary amines, taking ethylamine as a typical primary amine. A primary amine contains the -NH2 group attached to either an alkyl group (as it is here) or a benzene ring. As far as these reactions are concerned, the nature of any hydrocarbon attached to the nitrogen makes no difference. The nitrogen atom is the important bit.
Again, notice how similar these two molecules are around the nitrogen atom - and also how similar they are to the previous ones containing oxygen. Both types of molecule have an active lone pair of electrons attached to one of the most electronegative elements. All of these molecules also have at least one hydrogen atom attached to the oxygen or nitrogen.
Why are acyl chlorides attacked by nucleophiles?
The carbon atom in the -COCl group has both an oxygen atom and a chlorine atom attached to it. Both of these are very electronegative. They both pull electrons towards themselves, leaving the carbon atom quite positively charged.
The Overall Reaction
We are going to generalize this for the moment by writing the reacting molecule as "Nu-H". Nu is the bit of the molecule which contains the nucleophilic oxygen or nitrogen atom. The attached hydrogen turns out to be essential to the reaction. The general equation for the reaction is:
In each case, the net effect is that you replace the -Cl by -Nu, and hydrogen chloride is formed as well.
Since the initial attack is by a nucleophile, and the overall result is substitution, it would seem reasonable to describe the reaction as nucleophilic substitution. However, the reaction happens in two distinct stages. The first involves an addition reaction, which is followed by an elimination reaction where HCl is produced. So the mechanism is also known as nucleophilic addition / elimination.
The General Mechanism
Step 1: Addition
As the lone pair on the nucleophile approaches the fairly positive carbon in the acyl chloride, it moves to form a bond with it. In the process, the two electrons in one of the carbon-oxygen bonds are repelled entirely onto the oxygen, leaving that oxygen negatively charged.
Notice the positive charge that forms on the nucleophile. Just accept this for the moment. It's much easier to explain why that charge must be there if you have a real example in front of you. This is fully explained in the pages on the reactions involving water, ammonia and so on.
Step 2: Elimination
The elimination stage occurs in two steps. In the first step, the carbon-oxygen double bond reforms. To make room for it, the electrons in the carbon-chlorine bond are repelled until they are entirely on the chlorine atom - forming a chloride ion.
Finally, the chloride ion plucks the hydrogen off the original nucleophile. It removes it as a hydrogen ion, leaving the pair of electrons behind on the oxygen or nitrogen atom in that nucleophile. That cancels the positive charge.
Jim Clark (Chemguide.co.uk)