Soap scum forms when fatty acids in bar soap react with minerals in hard water, creating a cloudy film on glass and tile.