The clownfish not only gets a wonderful living defense system from the anemone, but also an occasional meal from the scraps of fish the anemone fails to ingest. This relationship works both ways as the anemone will snack on any scraps the clownfish drops as well. The action of the clownfish also stirs up fresh water currents and moves them over the sedentary anemone.
So, how does the anemone know not to sting? There are a few different theories. One is that the anemone doesn't know, but that the mucus coating of the clownfish protects it from the anemone's toxins. This is possible because clownfish that have had this mucus wiped off of them have been stung and killed by their previous hosts. Another theory states that the chemical content of the mucus coating prevents the anemone from recognizing the clownfish as a food source, and therefore the anemone fails to react to the little fish's presence.