Nucleophilic or electrophilic character of aldehydes and ketones

In neutral or acidic medium: electrophiles

The $C$ atom of the carbonyl group is activated as a result of its high positive partial charge. It is ready for nucleophilic attack (Nu = nucleophile): In acidic medium, the $O$ atom of the carbonyl group can pick up a $H^+$ ion and thus increase the electrophilicity of the carbon neighbor:

In strongly basic medium: nucleophiles

A very strong base (here ethanolate anion) can remove a hydrogen atom in α to produce an anion stabilized by mesomerism. This anion has a marked nucleophilic character on the α carbon :