a).Actually, the hard water contains Ca+2 and Mg+2 ions remain in the form of carbonates and bicarbonates which are insoluble in soaps and gives the insoluble product with the soap molecules like sodium stearate etc. So, the soap do not work in hard water.
b).Synthetic dtergent are much better cleaner than the soaps as they are made up of many petrolium products and so they have antibactrial nature too and they can easily displace the calcium and magnesium ions of hard water and so it can be used in hard water too.