The cat is believed to have allowed itself to become domesticated approx 5000 years in Egypt. The people of the area had given up the nomadic lifestyle of their ancestors, and decided to farm the land. As farmers depend upon the success of their crops which are harvested only once of twice a year, a means of storing them between harvests had to be found. Early on, this consisted merely of keeping grain in baskets which attracted mice, rats, and other vermin. The vermin in turn attracted the local lesser cat, the African Wildcat, who appreciated an easy meal.
Since the vermin ate the grain and the cats ate the vermin, people started encouraging the cats to stick around by leaving out the odd fish-head or other scrap, a practice of which the cats were fond. Since they had a ready source of food and an absence of enemies (various cat-eating creatures stayed away because of the men), the cats decided to hang around on a permanent basis.
Being naturally calm, the African Wildcat quickly adapted to people, and their canine companions. Cats sleep in short periods throughout the day, rather than a single long period like people and dogs, and awaken quickly. It is thus ready to do its job around the clock. It is also especially alert and active at night, when the mice are awake and the dogs are asleep. It sees and hears far better than the dog, especially at night, and does get along and co-operate with its canine companion.
When the ancient Egyptians finally started to live in cities, storing grain in windowless royal granaries, the vermin quickly multiplied. The then Pharaoh decided he needed more cats to help solve his problems…for some bizarre reason he decreed that cats should now be demi-gods and people were given a tax credit to bring their little bundles of godliness to the granaries early in the mornings and then take them home again at night. Since all cats were the property of divine Pharaoh, to kill or injure one, even by accident, was a capital crime. If a house caught fire, the cats were saved first, then, if there was time, the people .
Whenever a cat died in the normal course of events, the whole of its human household went into elaborate ritualistic mourning, often shaving off their eyebrows, chanting, pounding their breasts, and demonstrating other outward signs of grief at their loss. The body of the cat had to be carefully wrapped in linen and brought to the priests, who would check it carefully to be certain its death was natural. When the priests were done, the body was taken to the embalmers, who made a cat mummy of it. There were far more cat mummies than people mummies in Egypt: over 300,000 of them were found in the diggings at Beni-Hassan alone.
The ritualism and mythology concerning the cat spread far beyond their vermin-control capabilities. The people soon believed that the cats had a direct influence upon health, marriage, fortune, and other non-cat aspects of life. The goddess of life and family was Bast, who had a woman's body and a cat's head.
To remove one of the divine cats from Egypt was to steal from Pharaoh, a capital crime. As a result, it took a while before many domesticated cats turned up elsewhere in the Near East.
The exceptions to this were ships' cats: sailors have always been practical people. The Nile bargemen kept cats aboard for the same reason the priests wanted cats at the granaries, to kill the vermin. The bargemen would offload their wares to the Phoenician and other seagoing traders at the mouth of the Nile, sometimes offloading a kitten or three at the same time. In this manner the domestic cat slowly spread by sea to the various countries bordering the Mediterranean, and thence by overland caravan to the north and east.
It wasn't until the Persian, Greek and Roman conquests, however, that Egypt finally openly yielded her most valuable treasure, and the African Wildcat, now changed slightly into an early Domesticated Cat, spread over the Empires of Darius, Alexander and Caesar.
This theory is the best known starting point for the arguments surrounding the domestication of the cat. However, the recent discovery of evidence of domestication at Asian sites as early as 4000 BC to 5000 BC opens the question of independent domestication of cats among other ancient peoples. China's ancient archaeology is still relatively unknown and there is the possibility that a Chinese species of small cat may have also been domesticated around a similar time frame.
The fact that cat remains have been found in various ancient cities and settlements in places other than Egypt make it feasible that small cat species have always lived in or near human settlements, probably in a semi-tame state, attracted there by shelter and by food. Domestication may have occurred simultaneously in several distinct regions with Egypt being the best known example.
Whether other species have been involved in the evolution of the domestic cats cannot be determined with current DNA analysis technology.
Incidentally, many of the behaviours of pet cats are manifestations of their wild instincts e.g. scent marking, hunting toys. Many outdoor-going cats display a full range of wild behaviours e.g. hunting and marking/protecting territory. In indoor cats, instincts frustrated by close confinement can be redirected into problem behaviours which conflict with their attraction as a pet. It is understandable that humans want to keep pet cats out of harm's way, but unless the captive environment is enriched, the cat acts out its natural instincts as best it can. Some cats retain more wild behaviours than others which is why not all cats are suited to the indoor-only life forced upon them by the human environment.
Whether we like to admit it or not, our domestic cat companions are essentially still wild at heart, in their genes and instincts; something which keeps many pet behaviourist happily in business!!