Clownfish have a symbiotic relationship with sea anemones. This means that they benefit from living together, and neither one harms the other. Clownfish have a thick layer of mucus that protects them from the anemone's stinging tentacles. They also have special cells that allow them to recognize the anemone's scent and avoid its tentacles. In return, the clownfish helps to protect the anemone from predators and provides it with food scraps.
Other fish do not have the same protection as clownfish. If they try to approach an anemone, they will likely be stung by its tentacles. The stings can be painful and even deadly. Some fish may learn to avoid anemones after being stung once, but others may not be so lucky.