because hard WATER contains DISSOLVED salts of magnesium and calcium.When such water is heated in boilers it decomposes and a hard layer of calcium and magnesium carbonate is DEPOSITED at the bottom of boilers. In due course this layer renders the boilers useless. so it is softened before boiling .A water softener removes hard water minerals, like calcium and magnesium.