If you're on some kind of leadership programme or scheme then it's worthwhile. Otherwise I would never recommend staying in the same job long term. I've seen so many companies walk all over their employees because they know they will never leave. They keep them happy by spouting that ice cream trucks and summer parties are just as good as a meaningful pay rise.
From my perspective (including myself) push overs get walked over.
And as has been mentioned. It's not intelligence. It's confidence.
If you're happy with risk. The rewards are vast for chopping and changing jobs. Especially in this wage inflation cycle.
I barely do any different to what I did 4 years ago. But salary has almost doubled.
(part of that is lucking into an area that had (has?) a skills shortage and WFH opened up opportunity