Who is smarter: a person or an ape? Well, it depends on the task. Consider Ayumu, a young male chimpanzee at Kyoto University who, in a 2007 study, put human memory to shame. Trained on a touch screen, Ayumu could recall a random series of nine numbers, from 1 to 9, and tap them in the right order, even though the numbers had been displayed for just a fraction of a second and then replaced with white squares.

I tried the task myself and could not keep track of more than five numbers—and I was given much more time than the brainy ape. In the study, Ayumu outperformed a group of university students by a wide margin. The next year, he took on the British memory champion Ben Pridmore and emerged the "chimpion."

How do you give a chimp—or an elephant or an octopus or a horse—an IQ test? It may sound like the setup to a joke, but it is actually one of the thorniest questions facing science today. Over the past decade, researchers on animal cognition have come up with some ingenious solutions to the testing problem. Their findings have started to upend a view of humankind's unique place in the universe that dates back at least to ancient Greece.

Aristotle's idea of the scala naturae, the ladder of nature, put all life-forms in rank order, from low to high, with humans closest to the angels. During the Enlightenment, the French philosopher René Descartes, a founder of modern science, declared that animals were soulless automatons. In the 20th century, the American psychologist B.F. Skinner and his followers took up the same theme, painting animals as little more than stimulus-response machines. Animals might be capable of learning, they argued, but surely not of thinking and feeling. The term"animal cognition" remained an oxymoron.

A growing body of evidence shows, however, that we have grossly underestimated both the scope and the scale of animal intelligence. Can an octopus use tools? Do chimpanzees have a sense of fairness? Can birds guess what others know? Do rats feel empathy for their friends? Just a few decades ago we would have answered "no" to all such questions. Now we're not so sure.