In the case of the snail, the eggs came first.
The purple snail Janthina janthina drifts just below the surface of the ocean, waiting for its prey, by secreting mucus from its feet. The mucus is filled with air, which lifts the snail and allows it to drift from place to place. If this raft of bubbles ever breaks, the snail will sink into the ocean and die.
Scientists from the University of Michigan, US, and Leiden University in the Netherlands may have discovered how this floating strategy developed. DNA studies indicate that this method may be a refinement of a similar technique of the snail’s possible ancestor, the wentletrap snail, which lives at the bottom of the ocean.
Only female wentletraps produce mucus- slimy threads that keep them tethered to their eggs. Once, a very long time ago, air may have gotten into the wentletrap’s egg bubbles, forcing them to move up through the water and ending up at the surface.
When the eggs hatched, there was plenty of food for the baby wentletraps in the new environment. Consequently, evolution favoured the formation of air bubbles in the egg slime; over time, the males also adapted to produce slime.
The theory is supported by evidence from Australia — the scientists have examined a very rare snail from the Recluzia genus and noted that the females also produce a slime that encapsulates the eggs and lifts the snail. This species may occupy a developmental stage between the wentletrap and the purple snail.