That is because tap water is actually hard water, meaning it hasn't been purified and contains many impurities or various elements. These elements are commonly things like magnesium and calcium. When magnesium and calcium come into contact with soap, a basic solution, it forms the precipitate on various parts of the water solution.