If the water is hard, calcium and magnesium ions of the water combine with the negative ions of the soap to form a slimy precipitate of insoluble calcium and magnesium usually called soap curd (scum).
[soap]2NaSt+Ca(HCO3)2⟶[soap curd]CaSt2↓+2NaHCO3
2NaSt+Mg(HCO3)2⟶MgSt2↓+2NaHCO3
In permanent hard water, the formation of soap- curd will go on as long as there are calcium and magnesium ions present.
2NaSt+CaCl2⟶CaSt2↓+2NaCl
2NaSt+MgCl2⟶MgSt2↓+2NaCl
2NaSt+CaSO4⟶CaSt2↓+2Na2SO4
2NaSt+MgSO4⟶MgSt2↓+2Na2SO4
As long as the formation of soap-curd continues, no soap lather will be formed and the cleaning of cloth or body will not be possible.