I wouldn't say they aren't useful tools to the family. Put a couple cats in a warehouse and see all the vermin disappear. Likewise, let your cat in the garage and see that annoying mouse disappear forever. And of course, tons of people own dogs that alert the house for intruders, to say nothing about police and military attack dogs or service dogs.
If you're talking about when dogs and cats strictly became pets, it likely originated with the rise of civilization and likely began with the aristocracy who did not need pets to be guards/hunters as they had servants and peasants to do it for them.