Cats have mounted a silent takeover of the world. They’re in backyards, on T-shirts and motivational posters — and let’s not even talk about the internet. Now, a new study from a team of international researchers has determined how they managed to do it: through humans.

Researchers from the University of Leuven in Belgium, France’s National Centre for Scientific Research and the University Paris Diderot wanted to figure out when and why we’ve let felines into our lives rather than keep them outside as pest control.

They studied the DNA of more than 200 cats from the past 9,000 years, including mummified Egyptian cats and ancient Romanian cats from the Mesolithic era.

They found that cats spread around the world at two times: once due to farming practices, the other as trade routes began to open. But it was the Egyptians who made cats into the domesticated gods they are today.

“At some point … cats evolved this more friendly disposition to humans, so they went from pest-control agents to pets,” Claudio Ottoni, co-author of the paper published in the journal Nature Ecology & Evolution, told CBC News.

“Those that were more friendly were those that were more easily kept by humans.”