The sea anemone are known as the killer fish trap. The sea anemones are sea predators who traps small fishes in their tentacles and swallow them whole and also eat other sea creatures as well. But with clown fishes they need full protection. So, what happens is they befriend these sea predators as a protection from other sea predators. So once the clownfish befriends this predator, they get full protection from the sea anemone and develop a close bond. The clownfish after that hides themselves in the sea anemone slimy tenacles and the clownfish keeps coming back so they become even more close.
The clownfish also use the sea anemone as a home to keep safe and sound. So, like two best friends. As they both benefit from each other by protecting one another from any potential harm. Also, clown fishes are not affected by the sea anemone sting so that's why they're so close. The sting from their tenacles is there only defense and way to catch prey, however their stings are ineffective to the clown fishes. Resulting in such a strong bond between both the sea anemone and the clownfish.