In the case of barnacles and whales, only the barnacles benefit from attaching to the whales, but at no biological cost to the whale. This type of symbiotic relationship is known as commensalism. In this case, attaching to the whales gives the barnacles a stable place to live, a free ride, and access to plenty of food.
Barnacles begin their lives as free-swimming larvae, progressing through six larval stages. When they reach the last, or cyprid, stage, they settle onto the skin of a whale, where they complete their metamorphosis into juvenile barnacles. The juveniles — tiny creatures resembling shrimp — secrete cement that hardens into the hard, calcareous plates that surround them throughout their entire lives. As the cement plates meld together, the whale’s skin is pulled into the spaces between the plates, permanently fusing the barnacles to the whale.
For the entirety of the barnacles’ lives they’ll exist as diminutive hitchhikers on the backs and bellies of whales. They derive two basic benefits from this commensalistic relationship. As filter feeders, they depend on the availability of plankton, which they filter into their bodies through feather-like appendages extended through holes in their shells. When the whales swim into plankton-rich waters to feed, so do the barnacles. They are consistently carried from feeding to feeding. Protection from predators is another benefit. Barnacles attached to stationary objects often fall prey to fish, sea worms, starfish and snails. However, the whale-riding barnacles enjoy a certain degree of protection from the mobility of their enormous bodyguards.
For the most part, whale barnacles are harmless, even in astoundingly large numbers. In some cases, barnacles can actually protect the whales, like a suit of armour. Gray whales have been known to roll over when under attack from other whales, presenting their enemies with a back covered in hard, spiny, immovable barnacles.