Cats and dogs have accompanied humans for millennia. Dog fossil records go back around 40 million years, and cat fossils around 12 million years. To the best of our knowledge, dogs have been domesticated for at least 12,000 years.
This is a long time walking side by side, and it makes sense that our ancestors did their best to accommodate their furry friends just like we do.
In the beginning, the cat door was a hole in the wall meant to invite feral cats to come in and hunt rodents. We know the people of Cyprus had pet cats 9,500 years ago. They might very well have had cat holes too.
In more recent history, 14th century writer Geoffrey Chaucer described a cat hole in his Canterbury Tales, where a servant knocks on a door, no one answers, and he peeks in through the cat hole.
Nowadays, Sir Isaac Newton is most often accredited with inventing the pet door. He allegedly cut two holes in the wall; one for his adult cat and a smaller one for the kittens. It sounds like an urban myth created to show how even an incredibly intelligent person can have moments of stupid and not realize the kitten would follow their mother through the big hole…
Anyway, according to legend, Newton covered the holes with felt to keep excess light from coming in and disturbing his experiments. This would have been a predecessor of the modern cat flap.