Ion exchange resins are insoluble substances on which a fixed ion has been permanently attached as a part of it is structure, to keep resin structure electrically neutralized, each fixed ion must be neutralized with counterion (ion with opposite charge). this counterion is mobile which mean it can get into and out of resin easily.
softener resin
In softeners, cation resin is used on which the mobile ion is sodium. so, when hard water passes through resin, hardness ions (mg++, ca++) replaced by two sodium ions.
in mixed bed, strong acidic cation and strong base anion resin are mixed together. In order to produce deionized water cation resin, replace positively charged contaminates with H+, anion resin replace negatively charged contaminates with OH-.