There's more going on than that. A lot of companies are simply not great employers. They under-pay, under-appreciate, mis-manage, etc. These companies are going to end up paying a premium even for mediocre people. These companies tend to make things worse by having hiring policies that are setting them up for failure. Bad hiring policies ensure people won't even talk to you. You lose before the process even starts.

For example, I abort discussions gravitating towards "oh hey could you do this coding exercise" with a simple "No, I don't do coding exercises, ever. Good luck finding a junior engineer for your role.". I keep it polite but such a question basically means I'm talking to the wrong person that obviously has no idea why they should be begging on their knees for me to consider working for them.

The first contact should be with a decision maker that knows exactly why you are interesting for them. An HR person or recruiter does not qualify for this. Use them for screening CVs but don't ever let them do the initial out reach. If based on a CV, github profile, linkedin profile, etc. a you are not able to figure out why someone is interesting for a particular position or not willing to do the work to find that out, a phone call with an HR person is not going to be helpful. And if the match is obvious, you should move much more aggressively and faster.

Like everybody in the industry I get a lot of very poorly targeted outreach from completely clueless and incompetent recruiters. Most half decent engineers in this industry are busy, not looking, and blowing off recruiter spam on a daily basis. Inviting them to engage with your HR bureaucracy via some recruiter is a non-starter. The more qualified people are the less likely they are going to be interested in your coding exercises, screening mechanisms, job application bureaucracy, etc.

Cut all that bullshit and figure out what you want before even reaching out to someone and figure out how you differentiate from your competition (hundreds of other companies looking for the exact same thing). If some HR drone reaches out with some templated drivel, chances are extremely low that I even respond. It's not personal, I just don't have time to keep up with all the inbound nonsense I get. However, if a CTO of or engineering manager reaches out with a well motivated reason why I might be interested and what they are looking for, they'll get a reply and a conversation starts. I'm actually pretty approachable; you just need to do it right.

The way to fix hiring is to get HR and recruiters out of the loop as much and as early as possible. Their role is to screen and never to act as middle men. These people scare away all the good leads you might get, if any at all. They are the last persons you want people to talk to. In the case of HR quite literally, you involve them when you get to the salary negotiation phase. Screen based on the available resources. Use Google. Look at their Github profile, linkedin, etc. If you like what you see, make a plan for reaching out in the most effective way. E.g. find a way in via a mutual acquaintance (preferred) and be ready to move very quickly. If these people are available at all exactly when you need them, it's not going to be for very long. If they aren't, you need to be ready to really to sell leaving their comfy job for you. That starts with not treating them like numbers.