Dog lovers will find it baffling that cats are the world’s most popular pet. After all, they’re passive-aggressive, emotionally unavailable, and known for their chilly independence—traits that at most qualify felines for the role of “man’s best frenemy.”

It turns out, though, there’s an evolutionary reason for this tense relationship. That is, cats are in many ways still wild.

“Cats, unlike dogs, are really only semi-domesticated,” says Wes Warren, professor of genetics Washington University and co-author of the first complete mapping (paywall) of the house cat genome—specifically, that of an Abyssinian named Cinnamon.

Comparing the DNA differences between house cats and wild cats, Warren and his colleagues found that where the genes of domesticated kitties and wild cats diverge has to do with fur patterns, grace, and docility. The latter are the genes that influence behaviors such as reward-seeking and response to fear.

The context for this split is telling. The divergence likely began some 9,000 years ago, after humans had made the shift to agriculture. Drawn to the teeming rodent populations that gathered during grain harvests, wild cats began interacting with humans. And because cats kept rodents in check, the researchers hypothesize, humans likely encouraged them to stay by offering them food scraps as a reward. These early farmers eventually kept cats that stuck around.