The most appealing theory of how and when cats came to be domesticated goes like this. At the dawn of history, African wildcats made a choice to move in with humans, enjoying the relative warmth and comfort. And all they had to do in return was the thing that comes most naturally to them – hunting down mice and rats.
But there are other theories too…

This cute Tonkinese cat is a modern breed, but her ancestors were keeping us company thousands of years ago
The First Domesticated Cats
The general ballpark figure for the widespread domestication of cats is around 10,000 years ago. The rise in their fortunes coincides with the rise of agriculture. As soon as humans were storing grain, the rodents had a field day, and the cats had their work cut out. This theory would place domestication at about 12,000 years ago in the Middle East’s “Fertile Crescent” – the cradle of western agriculture, in a crescent-shaped area of fertile land around Egypt and Syria.
The earliest evidence we have of cats being kept as pets is a 9,500 year-old Neolithic grave in Cyprus containing a man and his feline friend. So, by the time of the cat’s most celebrated early heydays in Ancient Egypt (4,000 years or so ago), they were not exactly newcomers to the domestic hearth. But the Egyptians made a particular fuss of their pets, mummifying them, and worshipping the cat goddess Bastet amongst their vast reservoir of deities.

Bastet - ancient Egyptian goddess or just a pussycat?
Domestic cats – all descended from those African Wild Cat ancestors – arrived in Europe with Greek and Phoenician traders about 3,000 years ago. The Romans carried cats in their baggage wherever they marched.
Witchcraft and Black Cats
As we are reminded every Hallowe’en, black cats are associated with witchery. The origin of this bad reputation was in Europe, during the 14th century. No witch stereotype was complete without her cat ‘familiar’, and thousands of the poor beasts were killed as satanic vermin.
At which point people were reminded of why the cats were around in the first place. The rodent population boomed, and millions of cat-free rats brought millions of bubonic plague-carrying fleas with them. The cat cull had played a key role in the spread of plague, which decimated the European population for the first, but not last time, between 1346 and 1353.
Janine, 5 April 2020
I'm sure the statement "more households own a dog" does not take into consideration the Islamosphere, which is a huge swath of the world population but is often uncounted in world data studies. In Islam, the dog is considered an unclean animal, so pet dogs are almost never kept. In contrast, the cat is considered clean and pure, and was personally and explicitly endorsed by Muhammad as the ideal pet; he had several cats of his own, and doted on them and sang their praises. Thus many Muslims follow suit. A cat is, in fact, considered so clean by nature that the water from a cat's drinking bowl is labeled as appropriate to use for ritual cleansing of one's face and hands before prayer.