I'm a senior developer who has chosen to live both in expensive cities like New York, as well as rural areas.
I knew moving to the rural areas I'd make less in pay with the companies there, I accepted this because it also came with a lower cost of living. My skills grew but my pay was reduced. So was my rent.
Under your logic the local companies should compete with San Francisco salaries, because I "could" be making that much there. When I moved out of NYC I wasn't expecting other companies to compete with my former NYC salary, that would be absurd. The pay is high there because the cost of living is high, not because that is specifically what my talents are "worth".
Yes, the fact everyone is remote now is making everyone second-guess this assumption about pay and location. However, prior to remote work you got paid relative to the cost of living in your area. Programmers in Fargo, North Dakota made far less than programmers in Los Angeles, even with the same or greater skills.