Then they can't compete in that market. Market salary is not a high bar, it's the expected fair wage. If you can't pay market salary, you don't belong in business.
I think it's shortsighted to just throw up your hands and say "because free market" in this kind of scenario. The fact is if "market" salaries for software engineers are based on unicorn thinking and the salaries that Apple, Google and Facebook can pay, then there won't be much of a long-tail of interesting companies, we will all end up working for mega corps.
Supply of developers that both meet the high bar and are willing to accept poorer economic futures (see eg housing costs that have doubled in the last 5 years, expensive childcare, etc) is low. My experienced mid-career engineering peers keep moving to Austin, Seattle, and various cities in the midwest because being able to get a house for $300k, $500k, or $250k, respectively, massively changes their financial outcomes.
All the current H-1B debacle does is increase that power imbalance even further.
So very true; but if you're looking to make a quick buck you shouldn't join a startup [1] or want to checkout from work 5-6 pm everyday (BTW, there's nothing wrong with that) With the insane valuations that exist today, a decently funded startup can at least match a base salary with an established company.
[1] https://www.cbinsights.com/blog/startup-failure-post-mortem/
Freedom, ego, and voice have always been a bigger attractant for talent than salary, assuming basic life necessities are met. I've turned down multiple $300K+ job offers just because they were too boring, and simple brain rot would drain me of all the abilities that I have invested time learning and accumulating over the years.