They work with us, play with us and comfort us when we’re down. Archaeological evidence indicates that dogs have had a close bond with humans for millennia. But exactly why and how they evolved from their wolf ancestors into our loyal companions has been something of a mystery. Now a new genetic analysis indicates that dietary adaptation played a critical role in dog domestication.

Scientists have two theories for how dog domestication began. One holds that humans captured wolf pups and tamed them for their hunting and guarding abilities. The other, more popular explanation proposes that the advent of agriculture and the attendant development of human settlements created new scavenging opportunities for animals bold enough to exploit them, and that wolves themselves thus initiated domestication. The new findings support this latter view, and offer insights into how dog ancestors were able to take advantage of this new resource.

Erik Axelsson of Uppsala University in Sweden and his colleagues analyzed DNA from 12 wolves and 60 dogs representing 14 diverse breeds, looking for regions of the dog genome that evolved under selection pressure during domestication. Their search identified a number of probable targets of selection, including some genes related to central nervous system development. This is not unexpected. Modern dogs are well known to differ from wolves in having reduced aggression and social-cognitive skills that allow them to communicate with humans in special ways. Mutations in some of the nervous system genes highlighted by this study may have produced some of those behavioral changes that made Fido our BFF.

Intriguingly, genes involved in the metabolism of starch showed up among the targets, too. In fact, the study revealed that during the domestication of dogs, selection acted on genes involved in all three of the stages of starch digestion, promoting mutations that facilitated adaptation from a meat-centric diet to one heavy on starch. “Our results show that adaptations that allowed the early ancestors of modern dogs to thrive on a diet rich in starch, relative to the carnivorous diet of wolves, constituted a crucial step in early dog domestication,” the authors write in a paper published in the January 24 Nature. “This may suggest that a change of ecological niche could have been the driving force behind the domestication process, and that scavenging in waste dumps near the increasingly common human settlements during the dawn of the agricultural revolution may have constituted this new niche.” (Scientific American is part of Nature Publishing Group.)

Given previous studies indicating that dog domestication began some 10,000 years ago in the Middle East, Axelsson and his collaborators conclude that their findings may suggest that the development of agriculture—which seems to have started at around that same time and in that same area—“catalyzed the domestication of dogs.”

Cats, too, are thought to have domesticated themselves by exploiting the same new niche that attracted wolves. No doubt they were drawn in part by the mice that set up shop in early agricultural settlements. But the intrepid felines seem to have dined on human leftovers as well. Although housecats have only a limited ability to metabolize carbohydrates, including starch, they possess a longer intestine than their wild counterparts do--presumably to help digest the lower-quality sustenance they get from table scraps and trash heaps compared to the all-meat diet they would be living on in the wild, according to geneticist Carlos Driscoll of the National Institutes of Health, an expert on cat domestication.

“Why would the cat (or wolf for that matter) stick around eating crap like bread crusts?” Driscoll muses. “Because it's easier, and safer, than heading out into the wild and hunting.” In the wild “there is competition with other cats and also exposure to predators” such as leopards and hyenas, which humans would have kept away from their settlements,” he notes. And “the human environment is stable and year round, whereas wild populations of mice and rabbits and such prey are cyclical.” (Driscoll says that he and others are currently looking for signs of selection on carbohydrate metabolism in the cat genome.)

Still, the suggestion that the agricultural revolution kicked off dog domestication seems likely to generate controversy, not least because some evidence hints that domestication began well before farming did—including 33,000-year-old remains from the Altai Mountains in Siberia that are said to represent an early dog.