Origin of water "hardness"
Carbon dioxide reacts with water to form carbonic acid (1) which at ordinary environmental pH exists mostly as bicarbonate ion (2). Microscopic marine organisms take this up as carbonate (4) to form calcite skeletons which, over millions of years, have built up extensive limestone deposits. Groundwaters, made slightly acidic by CO2 (both that absorbed from the air and from the respiration of soil bacteria) dissolve the limestone (3), thereby acquiring calcium and bicarbonate ions and becoming "hard". If the HCO3– concentration is sufficiently great, the combination of processes (2) and (4) causes calcium carbonate ("lime scale") to precipitate out on surfaces such as the insides of pipes. (Calcium bicarbonate itself does not form a solid, but always precipitates as CaCO3.)