Whether your water comes from a well, or is supplied by your county or city, it contains minerals such as calcium and magnesium. These minerals come from deposits of limestone and chalk found in the earth, or from the underground pipes that supply your neighborhood. While relatively safe to drink, hard water has many negative qualities, not to mention it doesn't taste good!
The is simple answer is: HARD WATER COSTS YOU MONEY!!! Calcium leaves deposits (water spots and soap scum) on your fixtures, including faucets, sinks and showerheads--This means more time cleaning and more money spent on cleaning supplies. It also builds up inside your plumbing pipes and hot water heater, leading to reduced water flow and increasing the odds of clogs--This means costly repairs from a plumber. Hard water also causes soaps and detergents to lose effectiveness. It can keep dirt trapped in the fibers of your clothes and can stiffen and roughen the fabric--This means spending more money on dish and laundry detergent and your wardrobe.
Short answer: Science!!! The minerals in your water carry a positive charge. When water flows through the mineral tank of a water softener, it comes into contact with negatively charged beads that "trap" the contaminants. The softener uses a separate brine tank that flushes the beads with sodium chloride (salt), releasing the hard minerals and flushing them and the salt away.