Under base catalysis (NaOH, LDA), one carbonyl without Ξ±-H (e.g., benzaldehyde) acts as electrophile and one with Ξ±-H as nucleophile:
$$ R-CHO + R'CH_2COR'' \rightarrow R-CH(OH)-CH(R')-COR'' $$$$ R-CH(OH)-CH(R')-COR'' \rightarrow R-CH=CH(R')-COR'' + H_2O $$
(1) Aldol addition
(2) Dehydration (heat)