What is present in hard water that makes.it not to form latter readily with soap

Hard water contains high levels of minerals such as calcium and magnesium. These minerals react with the soap to form insoluble compounds that prevent the formation of lather. This interference with the lathering ability of soap is what makes it difficult for hard water to produce lather readily.