How does water become hard?
This depends on the surrounding geology. Rainwater is naturally soft, it becomes hard by soaking through chalk and limestone and dissolving some of the minerals.
Here is a graph showing the official government figures on the percentage of fuel wasted with the build up of scale. Just 1.5mm of scale will reduce the efficiency of your boiler by almost 10%.
When hard water is heated, the carbonates precipitate out of solution, forming scale in pipes and kettles. In addition to narrowing and potentially clogging the pipes, scale prevents efficient heat transfer, so a water heater with scale will have to use a lot of energy to give you hot water. Soap is less effective in hard water because its reacts to form the calcium or magnesium salt of the organic acid of the soap. These salts are insoluble and form greyish soap scum, but no cleansing lather. Detergents, on the other hand, lather in both hard and soft water.
Hard water can be softened (have its minerals removed) by passing it over an ion exchange resin. The ion exchange resins are complex sodium salts. Water flows over the resin surface, dissolving the sodium. The calcium, magnesium, and other cations precipitate onto the resin surface.