Cats, in general, are less intelligent than dogs, but they are loaded with instincts, so they can act both smart and stupid, at the same time.
There's another part to their intelligence I wish we could study... multiple times I've had cats show up on my front porch as though they somehow know my house is safe. Example: several years ago a cat knocked on my door and by the time we got things detangled we understood that it lived several blocks away and likely had been in a really abusive situation. Somehow that cat understood that if came to my house it would be safe, whereas my neighbors on either side would have at best ignored it. I've now had this happen multiple time such that there is some kind of pattern - pheromones?
Hypothesis: you have (or had) at least a cat at home, while your neighbors didn't, and a cat showing up on your front porch may think "better here because at least a cat can live here, even if it triggers a territorial conflict".
That said they must be fairly well matched intellectually or we wouldn't even be able to have this discussion.