Companies always interview a handful of candidates for each opening, so it feels like hardly anyone is passing because for each job, 1/7 gets it. On top of that just coding isn’t enough, you have to stand out so they can unambiguously say you’re the best. So you need soft skills and whiteboard skills as well.
So if they only hire the best 1/7, why do so many people say there are not enough coders on the job market and the demand is high? Why don't they just hire good coders too, not only the very best?
Coders are not interchangeable. You're a hot web programmer? Congratulations, you're not even considered for my job - I'm in embedded systems. You probably can't get hired to do deep learning, or Android programming. And the reverse is also true! There's all these programmers, and all these jobs, but nobody wants a generic coder. They want someone who can do the specific job that they have, or at least learn it quickly. When you're looking for a programmer, there aren't enough of the kind you want looking for work.
And then there's supply and demand. Good programmers are in limited supply at the moment. (Perhaps we could train more, but it's going to take time. At the moment, the supply we have is limited.) The demand is there, so the price rises until the supply and demand meet. That happens when some of those who want programmers get priced out of the market. To those firms, there's a shortage. That is, there's a shortage at the price they can afford to pay. But since they're the firms that would derive less value from those programmers, it's appropriate that they be the ones priced out. And if we had more (but not unlimited) programmers, we'd still have the same problem - there would be someone priced out who was complaining that there was a shortage of programmers, because they couldn't hire anyone at the price they could afford. When supply is limited, someone always gets priced out. To them, it looks like a shortage. But it's just a shortage at their price, not a shortage in general.
(There's also another problem: Programmers get paid really well. If you can fake it, and there's one company that you can fool, then you can get paid really well. That's a strong motivation to, shall we say, exaggerate your abilities. This leads to a number of "programmers" looking for work who can't program very well at all.)
Imagine you have 8 companies, each with one open position and different job requirements, and 7 coders who each apply to all 8 open positions and who each have different expertise. Every company extends an offer to the candidate who is best for them. No company hires more than 1/7th of the applicants, and every company hires only the best, yet at the same time there are not enough coders to go around.
Of course at the same time, the companies getting flooded with more applicants than they can hope to process are not the same companies struggling to fill positions, and the coders struggling through interviews are not applying to the jobs that will take anyone with a pulse.