Different types of detergents work best for various applications.
Detergents, as surfactants, bind their hydrophobic end to the dirt, while simultaneously binding their hydrophilic end to the water, bringing what normally wouldn’t mix with water into contact with it. This allows the water to actually clean the surface of whatever it is you’re cleaning, even though water would not normally stick to it.
Detergents Are Not Soaps
Soaps leave behind a filmy residue made up of calcium (Ca), magnesium (Mg), iron (Fe), and manganese (Mn), completely defeating the purpose of cleaning the surface. This soapy film is extremely hard to rinse off.
Detergents don’t leave behind this film, because they use a variety of surfactants (chemicals that make water wetter), which have been engineered to perform well under conditions in which soap does not perform very well.