Dogs and wolves hail from a common canine ancestor. And though you can still see a strong resemblance, many traits distinguish the two today. Wolves have larger teeth and skulls than dogs do. And they’re far less likely to bring you your newspaper and slippers.

To figure out how such differences might have evolved, researchers compared the DNA of a dozen wolves and 14 different dog breeds, from cocker spaniels to German Shepherds. And they found 36 places where the dogs’ genes stray from those of the wolf. Some of these genes have to do with the brain, but a surprising number help pooches process carbs. [See also Kate Wong, Adaptation to Starchy Diet Was Key to Dog Domestication]

That metabolic trick may have made it easier for dogs to stomach hanging around with humans, particularly once people started farming. The leftover grains in the scrap heap may have attracted animals that, over time, evolved an ability to carbo-load. And ultimately convinced them to stay.