the nitrogen lone pair delocalizes into the carbonyl, giving amides partial double-bond character at the $C-N$ bond (and explaining why amides do not behave like typical amines in nucleophilicity).