Soap do not lather with hard water because the hard water contains too much of soluble salts of magnesium and calcium. So when the soap is trying to mix up/react with water to produce foam/lather they have to first react with the salts and then break them down so in this process most of the soap and time is wasted still proper lather is not produced. But soap forms lather with soft water as they don't have soluble salts in them.