An ion-exchange resin or ion-exchange polymer is an insoluble matrix (or support structure) normally in the form of small (1–2 mm diameter) beads, usually white or yellowish, fabricated from an organic polymer substrate. The material has highly developed structure of pores on the surface of which are sites with easily trapped and released ions. The trapping of ions takes place only with simultaneous releasing of other ions; thus the process is called ion-exchange. There are multiple different types of ion-exchange resin which are fabricated to selectively prefer one or several different types of ions.
In this application, ion-exchange resins are used to replace the magnesium and calcium ions found in hard water with sodium ions. When the resin is fresh, it contains sodium ions at its active sites. When in contact with a solution containing magnesium and calcium ions (but a low concentration of sodium ions), the magnesium and calcium ions preferentially migrate out of solution to the active sites on the resin, being replaced in solution by sodium ions. This process reaches equilibrium with a much lower concentration of magnesium and calcium ions in solution than was started with.
The resin can be recharged by washing it with a solution containing a high concentration of sodium ions (e.g. it has large amounts of common salt (NaCl) dissolved in it). The calcium and magnesium ions migrate off the resin, being replaced by sodium ions from the solution until a new equilibrium is reached.