Sometimes there are neither time nor resources available to train new staff AND maintain the same level of productivity that existed with your team of veterans.
Not to mention that you likely end up training your replacement.
The real solution is to make yourself so indispensable that the organization can't function without you.
That's easy enough if your company has less than a hundred employees, but Boeing has 168,000.
There's always going to be someone cheaper (if not quite as skilled) to take your spot.
Forcing out expensive, skilled, older workers in all fields might make short-term business sense, but companies that do it, and our economy on the whole are
going to suffer in the long run as it becomes more and more a part of corporate culture.