Anti-foams are added in certain types of detergents to reduce foaming that might decrease the action of the detergent. For example, dishwasher detergents have to be low foaming for the dishwasher to work properly.
Defoamer is added into the recovery tank of carpet extractors to prevent too much-foaming damage to the vac motor.