The carbonate ions react with the Ca and Mg (which make water hard) to make calcium carbonate and magnesium carbonate (respectively). These are both insoluble precipitates.
Explain what an ion exchange column does to remove hardness of water.
The resin supplies hydrogen or sodium ions. As the hard water passes through the Ca and Mg ions are replaced by the H or Na ions.