I truly wish I lived in the world you imagine. I've been in the job I'm leaving for 13 years, received top-tier performance reviews every year, constant improvement, very good software, technical lead of one of the most profitable teams in the entire (huge) company. Everyone who has ever worked with me directly has great things to say. Meanwhile the vice presidents of such-and-such that play musical chairs with their titles every 2 years do not care. I have made it very clear what they need to do to keep me (and it's not onerous, in fact it's mutually beneficial for everyone and completely in line with the CEO's vision), and they do not care. I'm not sitting in the right seat; I'm not already buddies with the right VP; so fuck me. I can go get fucked.
It honestly sounds like you either have no real-world experience or you've gotten extremely lucky with the company you found. If it's the latter, do whatever you can to stay there as long as it doesn't turn to shit (and it can, at any point).
So everyone assuming that I stopped learning anything new 12 years ago can fuck right off.
I'm not saying this to brag, I'm saying this to point out that all these assertions that "you should change jobs every 2 years or you stagnate" or "you can't learn your job deeply in 2 years" are both completely unfounded bullshit assumptions. It completely depends on what the job is.
The reality is that for a massive number of devs working for traditional businesses, there isn't all that much on the table. You can try to move up into the management caste and get big bumps, but you're only going to get incremental advancements.
I actually wonder if any companies have considered massive salaries to be a liability in litigation, because it could be pointed to as an example of unfair wages.
Anyway, you're getting a fancy management job, or some super elite dev job.
Similarly, I have worked at places that have had "good devs" who didn't have such image problems, that worked at places that did not understand (or appreciate) what it was that they had, and did nothing to keep them on the staff. "Whatever. It's hiring season anyway." After their departure, productivity suffered, and when points were reiterated (that were covered before the person left), the response was something along the lines of a timid, "Oh...I thought you were joking."
Your assumption is constructed around the idea that people will always do what is in their best interest, and be in a frame of mind to appreciate the "big picture" things. In my own experience, this is rarely the case. More often than not, it is a sort of miracle that even some very well-known places are able to stay in business.
I'm sure there are exceptions, of course. Some upper management really are very smart and "keyed in" to the value of specific employees output and are also in a position to do something about it. I would simply argue that those arrangements are significantly less common than you might be led to believe, and that such remedial, reactive measures are unsuccessful far more often than they are successful.
Just a thought!