There is a limit on how much salary anyone can command in a purely technical position. And at some point in a career there is so much critical information in your head at a company that they start paying for you to 'not leave' rather than 'compatible salary'. You can't pick up that 'don't leave' premium at the new job until you're indispensable.
Working through that value equation can be hard, especially if you don't have a lot of self awareness to begin with.
I'm still figuring out ways to not get into a rut like that...
The longer you're at a big company, the more you get used to it, and the harder it is when it's time to move on. I worked at a big SV company for ~4 years, did extremely well, stack ranked in the top 5%, got raises, my last review I got a "critical talent stock award" -- it's easy when that's happening to imagine yourself there forever.
Then over about 6 months my division was divested, my manager was replaced, and a bunch of us in the old regime got laid off at once. It was heartbreaking, I was in shock. I bought my first house there, had 2 kids as an employee. Transitioned really to a fully-formed adult there. The work was interesting and I had a wonderful team. The job was a part of me, and I went from blessed top performer to the soup line in a matter of months.
But that's what happens when you don't manage your career really hard. If I had been smart/ruthless, I would have moved diagonally to a new company and started making a name before they had the chance to make a move on me. But I fell for the siren song (and vesting schedule) of the Big Corp. This isn't an unusual story.