A hot new study in Nature has rearranged the molluscan family tree--with some surprising results!

No one can deny that cephalopods (squids, octos, and cuttles) are the brains of the family, with their cousins the gastropods (slugs and snails) coming in a close second. We'd all assumed that these two groups were closely related, with cephalopods evolving from a gastropod-like ancestor, refining a brain that already existed.

However! As summarized in the New Scientist:
But in Kocot's new family tree, snails and slugs sit next to clams, oysters, mussels and scallops (bivalves), which have much simpler nervous systems. The new genetic tree also places cephalopods on one of the earliest branches, meaning they evolved before snails, slugs, clams or oysters. All this means that gastropods and cephalopods are not as closely related as once thought, so they must have evolved their centralised nervous systems independently, at different times.
Not only do they think cephalopods and gastropods evolved their brains separately, they actually think brains evolved three separate times within the gastropods. (N.B. I am using "brain" as casual shorthand for "centralized nervous system" here.)

However, as my invertebrate zoology professor once pointed out, using the instructive tale of Pycnopodia and a snail, it's not always the size of your brain that matters as much as what you do with it.

Pycnopodia is a sea star. Its nervous system is no more than a distributed nerve net, and it has no kind of brain at all. Despite this limitation, Pycnopodia rampages through the subtidal landscape, terrorizing all and sundry.

Now consider the classic sea snail with a beautifully centralized nervous system. This creature can only reliably accomplish two things: it can move toward food, and it can move away from Pycnopodia.