The desert cat was ubiquitous in Egypt when it was settled by the first agricultural humans, thousands of years before recorded history. For a while, since the desert cat (and other cat species) did not compete with them for food or try to eat them, humanoids invited them to come around and did not attack them. The cats controlled the mice and snakes that frequented the valuable granaries and got easy meals; humanoids got grain that wasn’t spoiled or consumed by rats and mice, and were not threatened by the snakes that came around to eat them.
Though cats did not contribute significantly to the actual survival of humans, they were still seen as intelligent, motherly, a manifestation of fertility and protection, and loved as much as relatives.
When a cat belonging to someone died (as opposed to the semi-ferals that still wandered the granarie,s long after domestication), they were expected to go into the same level of mourning as proceeding the death of an immediate family member, including shaving off their eyebrows, somber dress, and (if they could afford it) commissioning their cat to be mummified.
Handbook to Carnivora. Part I: Cats, Civets, and Mungooses. Richard Lydekker, 1896.