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 exceeds, when more calcium and magnesium dissolve.
Magnesium and calcium are positively charged ions. Because of their presence, other positively charged substances will dissolve less easy in hard water than in water that does not contain calcium and magnesium. This is the cause of the fact that soap doesn't really dissolve in hard water.