Surfactants are chemical compounds that are found everywhere in our everyday lives. Among other things in cleaning and detergents. For example, they cause fat to dissolve in water.
A surfactant molecule consists of a water-loving (hydrophilic) and a water-repellent (hydrophobic) part of the molecule.
The hydrophobic part envelops the dirt, the hydrophilic part connects the dirt with the water and thus dissolves it.
Nonionic and anionic surfactants are generic terms for different types of surfactants that differ in charge.
Due to their negative charge, anionic surfactants can better dissolve (positively charged) dirt particles and bind them into an emulsification. This increases the washing power. Nonionic surfactants tend to be better at dissolving grease.