Electronic factors:
But why is there this diversity in reactivity? The 1st step in the nucleophilic substitution mechanism (including the addition of a nucleophile to the electrophilic carbonyl carbon) is the rate-determining step. Hence, the much more electrophilic this carbon is, the more reactive it will be. The nature of Y has a major effect in this respect.
Y is related to the acyl group through an electronegative heteroatom (Cl, O, or N) that creates the carbonyl carbon much more electrophilic. The extent to which this occurs depends upon the electronegativity of Y. If Y is powerfully electronegative (for example chlorine), it has a major electron-withdrawing effect on the carbonyl carbon creating it more electrophilic and much more reactive to nucleophiles.
Figure: The electrophilic center of a carboxylic acid derivative.