Detergent is a broad term for chemical compounds that are amphipathic-possessing different segments-one that is hydrophobic (water-hating) that can sink into and break up fats and grease- and one part that is hydrophilic (or water-loving) and can be hydrated by water. The hydrophobic part absorbs into a contaminant, lifting it out, while the hydrophilic part allows it to dissolve into water, removing the contaminant. Soaps as detergents are generally made from plant or animal fats and lye (sodium hydroxide), in a process called saponification, and are some of the oldest chemicals made and used by man since antiquity.
Surfactants are chemicals that break water surface tension between grease and lipids, and those used in laboratories such as Tween 20 and Tween 60 are also considered to be detergents, lowering the surface tension between a liquid and materials, allowing them to admix and dissolve. Some detergents are used to dissolve proteins and fats specifically, and specific detergents and surfactants are used extensively in research, commerce and industry. Please reach out at Ask A Chemist for help navigating detergents, surfactants, fats and lipids.