

Carbonyls can function as both a nucleophile and an electrophile. The polarity of the carbon-oxygen bond causes there to be a partial positive charge on the carbon atom and a partial negative charge on the oxygen atom. This electron-deficient carbon atom acts as an electrophile. The carbonyl group can also act as a nucleophile. The oxygen of this functional group is electron rich because of its lone pairs and the pi bond. Nucleophilic attack on another molecule by the lone pairs on oxygen or by the pi bond give the same result because the products are resonance structures and thus identical.
