When water is referred to as 'hard' this simply means, that it contains more minerals than ordinary water. These are especially the minerals calcium and magnesium. The degree of hardness of the water increases, when more calcium and magnesium dissolves.
A water softener is a unit that is used to soften water, by removing the minerals that cause the water to be hard. A water softener collects hardness minerals within its conditioning tank and from time to time flushes them away to drain.