A common octopusAlexis Rosenfeld / Getty Images

A small shark spots its prey—a meaty, seemingly defenseless octopus. The shark ambushes, and then, in one of the most astonishing sequences in the series Blue Planet II, the octopus escapes. First, it shoves one of its arms into the predator’s vulnerable gills. Once released, it moves to protect itself—it grabs discarded seashells and swiftly arranges them into a defensive dome.

Thanks to acts like these, cephalopods—the group that includes octopuses, squid, and cuttlefish—have become renowned for their intelligence. Octopuses, for example, have been seen unscrewing jar lids to get at hidden food, carrying coconut shells to use as armor, barricading their den with stones, and squirting jets of water to deter predators or short out aquarium lights.

But why did they become intelligent in the first place? Why did this one group of mollusks, among an otherwise slow and dim-witted dynasty of snails, slugs, clams, oysters, and mussels, evolve into creatures that are famed for their big brains? These are hard questions to answer, especially because cephalopods aren’t just weirdly intelligent; they’re also very weird for intelligent animals.

Members of the animal kingdom’s intelligentsia tend to be sociable; indeed, the need to remember and manage a complex network of relationships might have helped drive the evolution of their brains. Smart animals also tend to be long-lived, since a large brain both takes a long time to grow and helps an animal avoid danger. Apes, elephants, whales and dolphins, crows and other corvids, parrots: They all share these traits.

Cephalopods do not. With rare exceptions, most of them are solitary animals that aren’t above cannibalizing one another when they meet. Even those that swim in groups, like some squid, don’t form the kinds of deep social bonds that chimps or dolphins do. Cephalopods also tend to live fast and die young. Most have life spans shorter than two years, and many die after their first bout of sex and reproduction.

This combination of short lives, solitude, and smarts is unique to cephalopods. And according to a recent paper by Piero Amodio from the University of Cambridge and five of his colleagues, the traits are all linked to a particular development in the octopus’s evolutionary history: Its ancestors lost their shells.

About 530 million years ago, an ancient group of mollusks slowly modified their protective shells into buoyancy aids by filling them with gas. With this transformation, they could more easily walk along the ocean floor, and then swim over it. They were the first cephalopods. For eons, they and their descendants kept their shells.

But about 275 million years ago, everything changed. It’s possible that competition from fast, shallow-water fish forced cephalopods to become more agile, or drove them into deeper waters where buoyant shells would have been a hindrance. For these reasons, or perhaps others, the ancestors of octopuses lost their shells entirely, while the ancestors of squid and cuttlefish internalized theirs. (The white, brittle slabs that people feed pet birds are cuttlebones, the internalized shells of cuttlefish.)

Unencumbered by a shell, cephalopods became flexible in both body and mind, according to Amodio and his colleagues. They could move faster, expand into new habitats, insinuate their arms into crevices in search of prey. “This allowed them to feed on many more kinds of food, requiring more complex foraging techniques,” Amodio says. “We think this is one of the key challenges that pushed them to become smarter.”

Losing their shells also made the cephalopods exquisitely vulnerable. One scientist described their soft, unprotected bodies as the equivalent of “rump steak, swimming around.” The rest of the ocean seemingly agrees: Almost every major group of predators eats cephalopods, including dolphins, seals, fish, seabirds, and even other cephalopods. This gantlet of threats might have fueled the evolution of the cephalopods’ amazing color-changing skin, their short life spans, and their large brains. After all, intelligence can help an otherwise defenseless creature create new defenses, as Blue Planet II’s shark-defeating octopus so ably showed.

It’s telling that the nautilus—the only living cephalopod that still has an external shell—bucks all of these trends. It lives for up to 20 years, reproducing several times during its life. It also has a much smaller brain than its shell-less relatives, and doesn’t seem to be anywhere as smart. The loss of the shell “has been linked to so many of the adaptations that make cephalopods special,” Amodio says.

But Ernesto Mollo from the National Research Council of Italy isn’t convinced. In a rebuttal paper, he and two colleagues argue that the evolution of intelligence takes many generations, and cephalopods would surely have been exterminated by their legion of predators if they only started that process after they had lost their protective shells. “A gradual and relatively slow evolution of intelligence would not have allowed the survival of hypothetical shell-less, but still unintelligent ancestors,” they say.

More likely, they argue, the path to intelligence began while the shells still existed, perhaps to help early cephalopods control their jet propulsion, or process the information from their well-developed eyes and many arms. “This suggests that the gradual evolution of intelligence in cephalopods facilitated the loss of the shell, and not the opposite,” Mollo and his colleagues write.

Amodio actually agrees with that. “We made clear that this process was really long and started before the shell was lost,” he says. Shelled cephalopods like nautiluses may not be thinking on an octopus’s level, but they can still outsmart snails or clams. They were preadapted for intelligence. But they only made that big leap forward, Amodio argues, after they got rid of their shells.

It’s not like they were totally defenseless in the interim: They could jet away quickly and squirt clouds of ink. Also, Amodio adds, think about their camouflaging skin. It’s an exceptional defense, and it must have evolved after the loss of the shell because color-changing skin would have been useless when hidden by armor. If they had time to gradually evolve one complicated defense after losing another, then surely they had enough time to evolve intelligence too?

All of these were gradual processes that probably overlapped in time. “You can’t lose your defense before you have the alternatives ready, no question,” says Jennifer Mather, a cephalopod expert from the University of Lethbridge. “Likely, they had a good dose of the intelligence they are noted for, the shell gradually shrank or became more internal, and with less protection, the behavioral flexibility became much more important and gradually turned into the intelligence we see today.”

Amodio adds that his ideas still need to be tested. For example, researchers could compare different species of octopuses on the same tests, to see whether species that forage in more complex ways, or live in habitats with more predators, are also smarter. That’s surprisingly hard: It’s not obvious how you would test the cognition of a creature as alien as an octopus, and it’s telling that many demonstrations of their intelligence are anecdotal. “We have a lot of evidence that their behavior is flexible, but we still need to test how smart they are,” Amodio says.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.