“My guess is that people in the middle ages were likely better at catching and killing rats than their modern counterparts...”
They bred plenty of animals to catch rats, both house cats and various dog breeds. But I believe those were mainly used to keep rats from eating all the agricultural production. I doubt there was much attempt at all to stop rats in the cities.
The best mouse, mole and rat killer we ever had was our miniature dachshund who was bred to be a sporting dog in Alabama. He used to come back with a "gift" for us far more often than any cat that we have ever owned. Since he got old and died we have had a terrible problem with moles.
Go to a big chity like Chicago or New York.
Rats. Millions of them.
Here in the hinterlands we don’t see them much. Why? Cats, dogs, coyotes, hawks, eagles, and bored boys tend to thin them out.