When attacked by an ant, the caterpillar of the small mottled willow moth is capable of regurgitating a drop of liquid containing surfactants. The liquid is not toxic or irritating (if sugar is added to it, ants will eat it), but the surfactant overcomes the hydrophobicity of the ant's integument, allowing the liquid to cover the ant rather than rolling off. Since ants and other small insects breathe through their skin, the ant has to hurridly get the liquid off to avoid drowning.
Manufacturing detergents/surfactants is not rare. Apparently other moth caterpillars and at least one beetle are capable of the same feat, and of course the human lung surface is completely covered with surfactant, which allows the airspaces to remain open. It is, however, impressive to see the material being used as a self-defense mechanism.