Soaps and detergents are not the same. Soaps are water-soluble salts of fatty acids; detergents are mixtures of surfactants. Almost all laundry products are detergents, while many 'beauty' products remain soaps.
Soaps are prepared from the reaction of fats and oils with a base such as sodium hydroxide. Fat and oil molecules have a glycerol backbone with three fatty acids attached by an ester linkage. The base hydrolyzes the ester in a process called 'saponification' producing three soap molecules and a glycerin molecule. The soap molecule produced has two distinct parts; an ionic end, and a long nonpolar hydrocarbon chain. The ionic end of the molecule provides water solubility, while the nonpolar piece works to solvate nonpolar solutes including dirt, grease, and oil. Soap reacts with hard water ions (Ca2+, Mg2+) in forming a precipitate (called soap scum).
Detergents are molecules manufactured for their emulsifying properties. Detergent molecules have similar properties to soap molecules: an ionic end, and a long, nonpolar end or tail. Detergents tend to emulsify in the same fashion as soaps, but do not form precipitates with hard water .