Water softeners exchange calcium and magnesium with sodium. This exchange occurs as the hard water passes through a resin bed which attracts and holds calcium and magnesium in exchange for sodium. Calcium and magnesium cause hard water, and high levels can scale pipes, water heaters, boilers, and appliances, reducing water flow and efficiency. Cation exchange resins also remove barium, cadmium, copper, iron, manganese, radium, zinc, and other metallic, positively-charged ions.