The two-bed deionizer consists of two vessels - one containing a cation-exchange resin in the hydrogen (H+) form and the other containing an anion resin in the hydroxyl (OH-) form. Water flows through the cation column, whereupon all the cations are exchanged for hydrogen ions.
To keep the water electrically balanced, for every monovalent cation, e.g. Na+, one hydrogen ion is exchanged and for every divalent cation, e.g. Ca2+, or Mg2+, two hydrogen ions are exchanged. The same principle applies when considering anion-exchange.
The desalinized water then flows through the anion column. This time, all the negatively charged ions are exchanged for hydroxide ions which then combine with the hydrogen ions to form water (H2O).