It sounds as if your friend was in a very common trap for programmers: His employer needs an expert for the kind of code he has right now. As the code he has now becomes more and more outdated, finding experts for that kind of code is getting harder and harder. So he's paying your friend a high salary to keep him from leaving and to keep him from learning something new. This is obviously a very good position to be in: Your friend doesn't have to learn anything new and at the same time, it's getting harder and harder for his employer to replace him. That's why it's so easy to fall into this trap. It's the easiest path for both parties.
Your friend might be lucky and stay in that position until his retirement. But if his employer ever decides he doesn't need that old code any more, or goes out of business or gets bought by another company, your friend will suddenly find himself in a job market where much of his knowledge is over-specialized and out of date. Plus, learning new stuff doesn't get easier if you don't practice it. If this happens when he's in his thirties, he can still catch up. But if it happens when he's in his fifties... Well, just imagine how well someone would do in an average job interview if they didn't know anything that became mainstream after 1985.
IMHO, this effect explains a large part of unemployment among older programmers. I'm not saying there is no age discrimination, I'm just saying that this trap is very real, very dangerous and many people fall into it, as unemployment rates show.