When carbon dioxide (CO2) gas is bubbled through limewater, it reacts with the calcium hydroxide to form calcium carbonate (CaCO3) and water (H2O).
The calcium carbonate forms a white precipitate that settles at the bottom of the container.
The overall reaction is:
Ca(OH)2(aq) + CO2(g) → CaCO3(s) + H2O(l)
This reaction is a simple chemical test for CO2. If CO2 gas is present in a sample, it will cause limewater to turn milky.