1,2- and 1,3-diols react with aldehydes and ketones to form cyclic acetals. The equilibria are shifted towards the final product by removing the water formed by azeotroping with benzene or toluene.
Mechanism for the formation of cyclic acetals:
Step 1. Protonation of the carbonyl
Stage 2. Nucleophilic attack of the diol to the carbonyl.
Stage 3. Acid-base balance between ether and alcohol
Stage 4. Loss of water
Stage 5. Cyclization
Step 6. Deprotonation of the cyclic acetal