Magnesium and calcium are positively charged ions. Because of their presence, other positively charged ions will dissolve less easily 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 |