Sure, the internet is for cats, but who do we have to thank for bringing us these companions?

One answer comes from a paper published today in the journal Nature Ecology & Evolution. Researchers analyzed DNA extracted from the teeth and bones of over 200 cats. These remains span 9,000 years, and trace back to places from Viking graves to modern Angola. They found that cats spread in two waves — one from the Near East, and one from Egypt — traveling on ships to arrive in new places.

Before Grumpy Cat and Maru, there were farmers in the Near East (areas like Iran and Turkey) who stored grain. Grain attracts rats, and rats attracted — well, not cats, exactly, but their wildcat ancestor, Felis silvestris lybica. These farmers, noticing that these wildcats were useful for keeping down the rat population, were probably the first to domesticate the felines, which then spread to Europe by 4400 BCE.

The second wave originated in Egypt. Cats were rather popular in Egypt: just think about the Egyptian cat goddess, Bastet, and those cat mummies you can see in museums. From there, they spread to the Roman Empire and other areas, probably brought along on ships to catch the rats on board. Soon, these Egyptian cats became more common than the cats from the Near East.

In addition to figuring out where cats came from, the scientists checked the origins of one specific type of cat: the tabby. This breed’s stripes aren’t seen at all in wildcats. DNA markers suggest that the tabby first showed up in the 14th century in western Turkey, but it had become common by the 1800s. Today, tabby cats are absolutely everywhere — like arguably the most famous one of all, Garfield. I suppose we have those ancient farmers to thank for domesticating those sleek, proud wildcats and bringing us their descendant: a fat, lazy, lasagna-loving furball.