Seventeen years ago, my son adopted a scrappy, noisy, bouncy, charming young street dog and named him Gretzky, after the great hockey player. Five years later, my grandson Augie was born. Two remarkable things happened next. Gretzky transformed into a serene guardian of the new baby, sitting quietly curled up next to him. And he became the baby’s favorite companion. Almost as soon as he could walk, Augie loved wrestling with what was, objectively, a sharp-toothed carnivore twice his size. When Gretzky died last October, Augie was heartbroken.

This might seem like a banal story of a boy and his dog. But if you think about it biologically, it is extraordinary. What would turn the descendants of a wolf and a great ape into best friends? Humans have a distinctive relationship with other animals. We trade off human care for a horse’s speed, a cow’s milk or even a canary’s song, and the domestication of animals was one of the keys to human success. Dogs are the most ancient example: Wolves evolved to become human companions some 30,000 years ago. But how could this special relationship develop?

A new study from Rachna Reddy at Duke University, Henry Wellman at the University of Michigan and their colleagues suggests that the special link between people and dogs runs deep. Even toddlers spontaneously treat dogs like people—figuring out what they want and helping them to get it.

The researchers cleverly adapted a famous study by Felix Warneken. Dr. Warneken showed 18-month-olds an adult trying but failing to do something, like getting a pencil that was out of reach. Toddlers spontaneously went out of their way to help, but only when it was clear that the adult wanted the pencil. Cooperation, altruism and “theory of mind”—the ability to understand what other people want—are also distinctively human abilities, and they are in place very early. But do they apply only to people or to other animals too?

Read the complete article in The Wall Street Journal