It is useful to think of a portable water softener like a magnet. In chemistry, negatively and positively charged particles (ions) are drawn to each other – they are described as attracting. The magnesium and calcium ions that cause water hardness are positively charged.
Water softeners contain filters which are full of negatively charged resin beads. The positive ions ‘stick’ to the resin and are removed from the water.