Ion exchange water softening
A softener does not remove hardness so much as trade it. Calcium and magnesium are swapped for sodium on a resin bed, which is then regenerated with brine.
Text description
Hard water enters a bed of resin beads loaded with sodium ions. Calcium and magnesium ions bind to the resin more strongly and displace sodium, which enters the water. The output is soft water with additional sodium. When the resin is exhausted, concentrated brine is passed through, reversing the exchange, and the calcium-rich waste brine is discharged to the sewer.