Well, I think you've got to realise a few things here:
1. While almost anyone can learn to code, it takes time to learn how to code well, and someone who's just starting out will obviously struggle to pass interviews. I mean, would you hire someone who picked up a book about Python two days ago and just learnt how to write a loop?
2. There is a huge difference in the level of skill required by different companies. Many people who apply for coding jobs will be above average for some opportunities, below average for others and average for others still. Is your average CMS theme developer likely to get a job at Google?
3. People's perceptions of their abilities vary wildly. A lot of the time, they'll go for jobs well above their skill level on the off chance they'll get it, and this happens for everyone from complete beginners to actual expert programmers. They may be able to pass an interview and become a programmer at a company, it just won't be for the type of company they're applying to.
4. Just because anyone can code doesn't mean everyone can code right now. Does that stop them applying for jobs? Not really. But it sure makes it unlikely they'll get said jobs.
In other words, there are quite a few factors here, even assuming being able to learn to code is a universal human trait.
Edit: A few more
5. Some people get nervous or fall apart in interviews, hurting their chances.
6. Culture fit is important for quite a few organisations, and there'll be candidates turned down because their priorities differ from those of the people already there.
7. Interview questions often don't actually judge someone's programming skill. Many companies end up relying on Google esque logic puzzle bullshit that has no real effect on anything.
8. The skillset required for passing interviews is different from the one required for doing the work.
9. Sometimes personal issues get in the way of a good interview or opportunity. Perhaps the interviewer was having a bad day, or the interviewee misunderstood the question. Or the boss/other employees were racist/sexist/classist/agist/whatever or had a personal dislike of the candidate based on first impressions.
1. While almost anyone can learn to code, it takes time to learn how to code well, and someone who's just starting out will obviously struggle to pass interviews. I mean, would you hire someone who picked up a book about Python two days ago and just learnt how to write a loop?
2. There is a huge difference in the level of skill required by different companies. Many people who apply for coding jobs will be above average for some opportunities, below average for others and average for others still. Is your average CMS theme developer likely to get a job at Google?
3. People's perceptions of their abilities vary wildly. A lot of the time, they'll go for jobs well above their skill level on the off chance they'll get it, and this happens for everyone from complete beginners to actual expert programmers. They may be able to pass an interview and become a programmer at a company, it just won't be for the type of company they're applying to.
4. Just because anyone can code doesn't mean everyone can code right now. Does that stop them applying for jobs? Not really. But it sure makes it unlikely they'll get said jobs.
In other words, there are quite a few factors here, even assuming being able to learn to code is a universal human trait.
Edit: A few more
5. Some people get nervous or fall apart in interviews, hurting their chances.
6. Culture fit is important for quite a few organisations, and there'll be candidates turned down because their priorities differ from those of the people already there.
7. Interview questions often don't actually judge someone's programming skill. Many companies end up relying on Google esque logic puzzle bullshit that has no real effect on anything.
8. The skillset required for passing interviews is different from the one required for doing the work.
9. Sometimes personal issues get in the way of a good interview or opportunity. Perhaps the interviewer was having a bad day, or the interviewee misunderstood the question. Or the boss/other employees were racist/sexist/classist/agist/whatever or had a personal dislike of the candidate based on first impressions.