Thus, if you want to maintain the same piece of the same legacy application indefinitely, be terrible at at. Whereas, if you are good, do the job and move on. Whether that means moving upwards, or to new pastures, or embracing new technologies, being good means constantly renewing yourself.
The caution in all of this is that if you fail to be good, not only will you be irreplaceable, but you will also be immobile. So, either polish your skills on a regular basis, or polish your Swingline stapler.
"Second, employees who are truly competent and are eager to make a genuine contribution to the department soon resign from a mediocracy, leaving behind them the dross of nonproducers and internecine warriors. I term this effect the Inverse Gresham’s Law: A mediocracy hoards mediocre people and drives good people into general circulation."
To me what's more interesting is sociological studies of business promotion. I took some sociology courses at Cornell, and though I don't remember the exact studies, I understood the gist to look like this: businesses generally can be understood to promote like this:
First, promote whoever is (roughly) more senior: your new IT head is more likely the Alice, the Senior Developer who has been here for 5 years than Bob, Carol, or Dennis, the Developers who have each been here for 1 or 2.
If those are equal (e.g. Alice declines the promotion or reveals that she's also about to accept a different job), promote whoever is more replaceable. Bob, who is an amazing developer who has been stuck maintaining a big hairball system at the behest of a fussy client who constantly asks him to make little tweaks, is totally out of the running, even if he's the most qualified in other respects: we can't promote him because nobody can easily take over his old job.
Third, promote whoever "feels" better. This is a complex agglomeration of personal marketing, actual leadership instincts, and even factors like preferring someone who is worse at their job because the other person seems to have "found their niche". Carol, who is a "rockstar developer" who can pull together an awesome prototype in a week, is totally helpless if Dennis, a more hum-drum average programmer type, has higher-visibility projects, a good rapport with others on the management team, and who fought unsuccessfully but valiantly that one time to keep that key client. He's way less talented than Carol, but he "feels" more right for the job.
Another detail from that sociology course was studies of social power. People who were viewed as "powerful" in buisnesses were usually not the best-connected, but the most strategically-connected. That is, if your social graph can be mostly factored into two or three subgraphs which are well-connected internally but not well connected to each other (e.g. different departments that don't talk much to each other), then within a subgraph, the node which connects to the other subgraphs will feel like the most "powerful". Social power is about connecting subnets. The person with the most social power in IT is not the person who connects best with everyone in IT, but the one who talks regularly with people in Client Services, Marketing, and Accounting: they're "powerful" because someone comes to them saying, "hey, I have an accounting problem with my latest paycheck, do you know who I can talk to about that?" and they can immediately say, "Well, you normally want Erica but she said she's swamped this week, let me see if Flynn will look into it for you, he owes me a favor anyway since I solved a database problem for him."
Your developer why does a great job maintaining a hairball should be rewarded with life boosting things: paid for conference trips, a workspace of his/her choice, a book allowance, training courses of their choice etc.
Maslow's hierarchy of needs should guide the reward system, not Machaveilli's Prince.