The answer to 'how does water softener work' is that a water softener is a device that removes minerals, such as calcium and magnesium, from hard water. It works by using an ion exchange process to replace the hard water minerals with sodium or potassium ions. This helps prevent scale buildup, reduces soap scum, and improves the efficiency of appliances and plumbing.
The water softener has a tank filled with resin beads that are coated with sodium or potassium ions. As hard water passes through the tank, the resin beads attract and trap the calcium and magnesium ions, replacing them with the sodium or potassium ions. This 'softens' the water by reducing the mineral content. The softened water then flows out of the tank and into your home's plumbing system.