Companies across the industry are well known and notorious for having 4 year cliffs. HR often has no interest in keeping a good senior/staff level developer. Furthermore, companies are also known for making subsequent promotions harder than the first and are more than happy to let developers stagnate - managers at most companies are not responsible for providing growth opportunities beyond the so called "terminal levels" which is roughly senior/staff at most places.
The easiest way for many to keep learning, keep compensation in line with the market, and continue working on interesting projects is to simply hop for a new opportunity after a few years; cliff just makes the choice easier most of the time.
At least from what I have seen, one has to be really fortunate to have good managers/leaders (who can help with some of these issues) and/or a company which aligns very well with one's own goals over a long period of time. I don't believe either of these are common.