This is just true for tech overall. Job hopping will almost always lead to more money than staying at one place and navigating the ladder. What you gain with cash, you lose in clout.
It all comes down to your personal goals. If gaining 20-30% comp for the effort of building you resume and phonescreening and day long interview loops is worth it then it sounds like you shouldn’t stay somewhere for more than 2-4 years.
If doing the job above you for 6-10 months to maybe get 10-15% is more your speed, then find a company you wanna stick with for a while.
I’ve done both. Jumped until I reached a comp level I’m content with and now playing the promo game expecting minimal reward increase for my labor but enjoying the stability.