It goes up 20% each switch, but there still has to be a ceiling where the company can just hire 2-3 young people for the same price.
Consider someone making $60,000 getting a 10% raise vs someone making $200,000 getting a 5% raise.
The first will get $6,000 more per year, the other will get $10,000.
These days you also have to look at total comp as well.
My first job I was an entry level developer. If I had stayed there for 25 years earning 3% raises each year... my salary would have finally doubled last year. In real life, I left there after ~2.5 years, and left the next job after 2.5 years, at which point my salary had already doubled.
Of course staying in the same company, I'd likely have moved up some and gotten some promotions with meaningful raises along the way. That company was pretty small but... I know that a lot of colleagues at that time stuck around and are VPs of some sort now, as the company has shown consistent meaningful growth. Early on, though, there was little room for growth in the short term at such a small company.
My largest raise staying at a company was going from $9.05 / hour to $13.05 / hour. That's 44.2%. Ha! But realistically since being salaried, my single largest raise was a couple years ago during the inflation rush, where I got 13%. Often changing jobs would land me 15-20%, and I could generally do that every 3 years without any obvious negative consequences. Assuming a more conservative 12% at 3 years intervals (with 3% in the years between), after 24 years I'd be at around 4x my original salary after 25 years.
Comparing 4x to the 2x from my first example, I've come out double. Factor in possible promotions and maybe it would've been 2.5x vs 4x which is about 50% more. If the promotions came with substantial pay raises, it would start to favor staying put. Personally I haven't seen any promotions like that because I've always been valuable as an individual contributor, and less so as management. But individual results may vary. We're looking at "on average" though.
I later found out when I was leaving I made ~55% more than this person.
Also of note, 50% more of someone's salary is less than 50% of your own. If you make 200k and someone makes 100k, they need a 100% raise.
If you have been at a company for a few years getting promos and stock refreshers is always a struggle due to limited budgets and internal politics. On the other hand if you "boomerang" (quit and come back after a year or so) you will automatically get a higher title and a fresh new hire stock grant.