Aldehydes and ketones containing at least one a-hydrogen atom (i.e., a hydrogen atom attached to the α-carbon atom with respect to the functional group, aldehyde or ketone) when treated with dilute base (like NaOH, Ba(OH)2, K2CO3, etc.) undergo condensation to form β-hydroxyaldehydes or ketones called aldols or ketols respectively. Remember that it is the α-hydrogen atom that adds on the aldehydic group (see condensation of propanal).

Aldol when heated, loses a molecule of water to form unsaturated compound.
\(\underset {Aldol}{CH_3.CHOH.}CH_2.CHO \xrightarrow {heat} \underset {Crotonaldehyde (2-Butenal)}{CH_3.CH=CH.CHO}\)
Since formaldehyde (HCHO), trichloroacetaldehyde (Cl3C.CHO) and benzaldehyd (C6H5CHO) do not have any α-hydrogen atom, they do not undergo aldol condensation.