Soap is more effective in soft water. For the same reason, it is more effective in pure water than seawater.
Soaps are made from fats and caustics which don't lather up well in salt water, or in hard mineralized freshwater. Consequently, they also don't wash away dirt and grime effectively
Salt water contains chloride and sodium ions. The former are negative and the latter are positive. Salt, or sodium chloride, strongly dissociates. Yet, due to the balance between ions, sodium ions decrease the dissociation of soap components.
Learn more about soap here: