A water softener has polystyrene beads with sodium chloride ions. When the hard water passes over those beads, the mineral ions exchange with the sodium chloride ions. The amount of sodium is minuscule, so if you drink soft water or use it in cooking, it doesn’t have a salty taste.