Hard water contains dissolved chlorides, sulphates and bicarbonates of calcium or magnesium.These ions present in hard water form insoluble precipitates with fatty acids in the soap by replacing sodium ions present in it. All the insoluble compounds that are formed after the reaction of soap with hard water is called soap scum.