Mollusca in general exhibit more morphological diversity than any other phylum, including arthropods. The vast difference between the giant squid and microscopic nuculid clams is unmatched in the animal kingdom. The shells which mollusks have evolved function to help them with this difficulty by presenting a tough exterior to predators in search of a meal. It bears mention here that many marine mollusks get along fine without a shell, having adapted in other ways which help them escape being eaten, at least long enough to reproduce their kind. Squid are fast swimmers and many species travel in schools.
Many sea slugs are able to consume stinging cells of other animals like coral.
They transfer these natural deterrents to their own body cells where they function to instruct predators to avoid their kind. But in general, the phylum has flourished through epochs of geologic time wearing hard shells that afford excellent protection against all but the most determined foe. Mollusks have also adopted an amazing array of life styles and habitats. Marine mollusks burrow, creep, tunnel, float or swim. They make their homes in mud, sand, silt, coral grit, rock, shell, tidal pool or grass.