Softening water is a 4-step process.
1) The body of a water softener is a tank filled with resin beads. These beads are covered with sodium ions. As hard water passes through, the resin breads acts like a magnet, attracting the calcium and magnesium ions (hardness) in exchange for the sodium ions.
2) Eventually the resin beads become saturated with the mineral ions and have to be re-charged. This process is called regeneration, and is conducted by the control valve on the top of the tank. The control valve is a brain of the system,
3) During regeneration, a strong brine solution is flushed through a resin tank, bathing the resin beads in a stream of sodium ions which replace the accumulated calcium and magnesium ions (hardness).
4) The brine solution, carrying the displaced calcium and magnesium ions, then flushed down the drain by fresh water. The regenerated resin beds can be used again and again.