I feel like it's a meme in here about how companies are too dumb to pay their high performers market value and if only companies were smarter we wouldn't have to job hop as much. I'll argue that it's actually extremely rational with an example that happened with a colleague and me.
I've worked at a large bank for 2 years now (8 yoe total), I was hired as a senior and pretty quickly was doing the work of a lead, at the end of the year I got the promotion to lead, a decent bonus, but only a 5% raise. At the end of last year, I was told they put in a request for promotion to senior leadership, and that was declined but I still got a 12% raise and a decent bonus. I got the feeling I was underpaid and interviewed around, and got a comp increase of roughly 30% on top of my recent raise as a senior dev for a tech company. When asked whether they could get me to stay I said I wanted a 50% raise from my current salary. They came back with a counter of 30%, pretty much exactly matching my offer. When I said no they were shocked. At the time I didn't realize why.
Now in my notice period, I had a lot of good conversations with coworkers about careers and what we want out of the career including money, responsibilities, etc. I've always been very open to sharing salaries but being a bank people are a lot more conservative about stuff like that. Now that I was leaving I exchanged salaries with many on my team and honestly, I was shocked at how low some of the more senior team members were paid. One colleague we'll call Jeff had been at the company for 15 years and was promoted to lead the year after I was. Basically, the two of us were leading the two biggest projects on the most high-profile team, had about 4 juniors soft reporting to us, and I think he was slightly better technically than me but I think I had a slight edge in leadership/communication skills. So wow was I shocked to find that Jeff's total comp was under half of what mine was. He basically said he knew he was underpaid, even with his promotion he got like 5% (less than inflation) and other years have been 2-3%, and he said he'd been interviewing around. A week later he gets an offer for a much more technical role being a specialist in the exact technology he wanted to use, and the salary was almost triple his current salary.
Jeff turned it down. He said he makes enough to live comfortably, and that the current job is super great job security, he's the sole breadwinner in the household with 2 kids and a mortgage, so if he flamed out and was fired it could cause a huge problem with their finances. He said maybe he'll ask his boss for a raise when I leave. But they're obviously going to say no and/or handwave about maybe getting him something at year-end, and that's when the counter to my offer and their reaction to me declining sort of clicked for me. The average employee is terrified of change and terrified of the unknown. Now while I think this example is extreme, I think most people would stay at their job even if they knew they could get 30% more elsewhere. And companies know this.
Companies don't underpay because they're dumb, they underpay because they know that the vast majority of workers, they don't need to be paid market value to stay. My boss said he tried to get a 50% raise counter, and that if my offer letter had been for 50% more he thought they could have gotten it. But from HR's point of view, 99% of workers will not leave if there's no pay increase, so they basically thought my 50% was a bluff and I'd be delighted to get the raise I wanted and also keep my current job and stability. Also, the counter came quickly, they knew I was underpaid and they were quite happy to pay me the extra 30% once they thought I might leave. This is the mentality of companies and it's why they do what they do, not because they're stupid, but because workers are insanely risk-averse and they're smart. Maybe they could be a bit better and tailor their comp to people they predict might leave (I'd literally left my old company 2 years ago because they gave me a 30% raise from my old job, so they knew I'd do that if I was underpaid), but as a general policy underpaying people and dealing with the occasional Redditor type who will leave is more profitable than paying every dev their market value.
Thanks for coming to my Ted talk.