Companies don't do this. They will adjust your salary down based on your city of residence. Square is one example of this. You're not compensated for the value you provide, you're compensated for the cost of living near the office.
You're also now competing against a national talent pool vs locals only
You're also now competing against a national talent pool vs locals only