There's this model of the world we're taught as schoolkids - at least where I grew up - where you work hard at something, do as your told, and slowly but surely you rise up. And maybe at one level it's true, but it's very slow, and you'll never become the sort of success you read about in the paper that way.
Instead, I've found that what usually happens is that you join an organization because you meet some minimum skill baseline that they're looking for. And then as you practice and learn from the people around you, you end up picking up a bunch of other skills and getting better at your job. But the people around you generally won't notice. First impressions usually pigeonhole you into a general category, and then people are blind to gradual changes.
So to reap the rewards of everything you've learned, you have to expose yourself to new people. Jump ship, and suddenly you seem really valuable to them, because all those skills you've picked up which your current organization takes for granted are new and useful.
There's a leverage effect as well: people try to work with others of roughly the same level. If you're diligent about practicing, you'll go from being (hopefully) near the bottom of your team to the top of it. If you then repeat the process, your new teammates better be higher skilled still, and so your team as a whole can tackle more ambitious problems.
Unfortunately, it also works the other way: somebody works in a company until they recognize how useless that person is, and before he or she gets fired they jump ship to a new company where they are greeted with open arms as the new guy/gal that will fix everything. Lather, rinse, repeat. If they are smart they use the same argument you made to actually rise in the corporate hierarchy with each step. This allows them to beat the Peter principle and rise above their level of incompetence, leading us to totally incompetent people at the top of the hierarchy.
So if you see somebody who changed jobs every couple years, be careful.