This is where it gets tricky: as the older worker moves up the value chain, they become more experienced, more specialized, and more "known." This actually makes it more difficult for them to get a job, since it is then more difficult to find a "right fit." Compare to the generic fresh faced new grad: they can go anywhere, and are also unknown quantities, so you just hire them and hope for the best.
Senior hires are more difficult to make than junior hires, and what is worse: someone who is "old" cannot go back to being junior even if they wanted (e.g. career switch) since our minds seem to be biased (right or wrong) into associating age with expertise. They don't even have a chance at working at the 21 yro salary.
There is also a pyramid to worry about: many companies are much fatter at the entry level and this narrows at each level as employees are lost or weeded out. Now, if you are 40, you have to compete further up that pyramid, meaning fewer spots available, meaning...life is much more complicated. It doesn't really make sense though: where do all those extra young programmers go when they are old? Our industry is killing itself through in its thirst for young blood, since it actually discourages people from entering our field.