Young people can afford less salary but prefer equity, fun culture, amenities and perks (citation needed 2).
A Sr. Java Developer living in Charlotte, Atlanta or Texas needs to make a 6 figure salary to stay in a middle class level quality of living (2 kids, single family home, 2 cars, hole foods market)
A Single Developer in SF needs the same amount of money to live well in the city with roommates.
a NC bank wanting a good web developer can either pay a young SF developer the same money she is making there to compensate for the loss of "living in SF is more fun for young adults than in Charlotte" + "it's a bank, we don't have a ping pong table or beer in the fridge" effect.
Or pay a salary that is going to be enough for a bit older developer who has a family, to live comfortably.
If you consider that there is a cost to moving to Charlotte that is more than a monetary cost, that cost needs to be taken into consideration in the compensation.