Aldol condensation occurs when a Beta-Hydroxy carbonyl is exposed to heat. This reaction often occurs when an aldol addition is carried out in high temperature. The result is an alpha-beta unsaturated ketone also known as an enone.
This reaction can happen in either basic or acidic conditions. The main requirement is that 1 Hydrogen is present on the alpha carbon of the beta-hydroxy carbonyl (or 2 on the ketone or aldehyde substrate).
The reaction in basic conditions begins with the deprotonation of the alpha carbon. This forms an anion. The lone pair on the alpha carbon then forms a double bond at the alpha-beta position, kicking off the OH as a leaving group. This step is slow (OH is generally a bad leaving group) but irreversible. This is known as an EC1B reaction, and is possible due to stabilization of the negatively charged carbon by the adjacent carbonyl.
In acidic conditions, the mechanism begins with protonation of the alcohol. This makes a good leaving group (water), which then gets kicked off leaving a positively charged beta carbon. Next, another water molecule in solution deprotonates the alpha carbon, generating a pi bond between the alpha and beta carbon. This is reversible, but the product is favored.
The base catalyzed reaction occurs via an EC1B mechanism, which is very slow because it must lose a bad leaving group, hydroxide. This last step is irreversible. On the other hand, the reaction in acidic conditions is reversible, but the product is favored. However, removal of the aldol from solution would theoretically push more enone product back into the aldol form.