Resin is a porous and insoluble material.
The resin filter in the soft water machine contains millions of tiny plastic spheres (beads), all of which contain many negative-charge exchange positions that absorb positive ions. When the resin is in the new state? These charge-exchange positions are occupied with positively charged sodium ions. When calcium and magnesium pass through the resin tank, they are contacted with the resin beads, replacing the sodium ions from the exchange position.
The resin preferentially binds the cationic with strong charge, and the charge of calcium and magnesium ions is stronger than that of sodium ions. Replace the sodium cation and then go down through the resin "bed, out of the soft water machine, so that the softener sent out the" softer. Finally, all the resin exchange positions are occupied by calcium and magnesium, and can no longer work.