People always think this about their own trade. But let me assure you that I am dumb as shit and a pretty decent programmer as well. I've taught programming to beginner adults, who were coming out of prison or the military, and out of hundreds I ran across maybe a handful that truly truly were not ever going to be able to learn it to competence.
The main skill at play from my experience is comfort with the state of not having a clue, and tolerance for frustration. That's an uncomfortable emotional zone for work; people will frequently abandon the pursuit. But that doesn't mean they can't learn it.
It's like playing a violin or something: you could, anyone could if they put the hundreds of hours in. Who does put those hours in may be a self-selecting group, but it doesn't mean there's anything inherent in the skill itself that limits who can learn it.