It’s not safe at the bottom of the sea. Seaweeds and sponges that attach to the seabed manufacture toxins to keep from being fish food. To avoid being bit, they emit chemical signals to alert those that would otherwise be tempted. That is an opportunity for other potential fish prey to share the signal.
Sea slugs are oceanic snails without shells. They have adapted to take advantage of the noxious benthic fodder, eating nothing but toxic seaweed and sequestering the toxins themselves.
As the toxins serve as adequate protection, shells were no longer necessary. Several sea slug species also sequester the chloroplasts that power the seaweed, turning themselves into leaves that crawl.
Fire coral are misnamed. They are colonial marine organisms that look like coral but are more closely related to jellyfish and stinging anemones. Their fire is a nematocyte: a barb with chemical sting. Fire coral employ chemistry to get a better, higher spot in the water column: chemically sensing an inferior competitor nearby, then selectively expanding toward the competitor, and eventually overgrowing it.