First of all, what "cost of switching jobs" are you referring to?
If I live in SF, "switching jobs" likely means getting off at a different BART station. Hell, I might be able to walk to my next job.
I think the well-known fact that pay raises fail to keep up with market wages in tech - isn't some brilliantly efficient calculation like "current market value minus the cost of switching jobs right now" as you suggest.
It's clearly not working very well, since job hopping in the valley is crazy high, and everyone knows that's done because of pay. To wit, the longer you work for the same company, the farther your market comp will drift away from you, and the only way to catch up with the runaway comp-train is to hop jobs.
I think it's simply the traditional American 2-3% raise model clashing with a booming tech reality where your market wage will likely increase much higher. Plus, the traditional model itself never worked very well for well-performing employees:
> It used to be that jumping ship meant landing a salary 10 percent to 20 percent higher than your previous one. While increases of that size aren’t as widespread as they used to be, switching jobs is still the most common path to the best pay raise.
> If you stay at the same organization, your annual increases may be restricted by your current base salary because companies have a narrow percentage range within which they can boost your pay.
https://www.investopedia.com/articles/personal-finance/09041...
Simply stated: employers were never very efficient at raising comp for good performers. Even decades ago, in industries nowhere near the growth rate of current tech, top performers were much better off job-hopping. Tech just made it even more lucrative.