Check all the influencers and gurus out there. They stay for only around 2 years.
Which makes sense to maximize your potential and income.
Let's take the scenario, when you change job you might get a 30% hike.
First 2-3 months you and the team working with you will work to onboard you.
These folks always pick jobs where there is going to be new development or new tech.
So the next six months go into learning and development.
For enterprise customers with all customisation it will take 1 year for production usage. By the time they would be preparing for their next job and leaving the maintenance to other folks.
You can go checkout profiles on LinkedIn and see this pattern.
After say 8-10 years experience some folks have great breadth or depth. They get to lead large teams, they might not need to actively code but because of their pattern or learning they would be on top of new things and new organisational patterns which in turn helps them to acquire more skills for their next stint.
And these folks network a lot.
Hope you can learn from this and priorities what is important