Soaps and detergents both contain water, but detergents contain builders that reduce water hardness. Hard water makes it more difficult for the soap to bubble and contributes to the formation of soap scum.
Builders in detergents also maintain alkalinity, which helps emulsify grease and prevents soils from being redeposited on clothing during washing and rinsing. Another difference between soap and detergents is the ingredients used to make each product.
Most soap is made from natural ingredients such as coconut oil and potassium hydroxide. Detergents often contain synthetic ingredients such as dyes, sodium laureth sulfate, disodium phosphate and fragrances. Using detergents to clean clothes prevents insoluble compounds from building up on clothes.