The belief that old technicians are unwilling/unable to update their skillset is largely false. Only the bottom-tier of technical talent has such a learning disability. Most technicians can do this easily.
This false belief is used to justify ageism of course, but the real reason motivating ageism is the very true fact that young technicians are much more willing to harmfully overwork themselves than old technicians. New technicians naively believe that all that overwork proves their importance to their employer and secures them a high salary and a secure job. These things are entirely false, and come at a cost of health and life-enjoyment. By the time they learn these lessons the hard way, they have become old technicians who are no longer wanted.
As an aside...
Over the course of my career, I saw businesses adopting technologies which are not very portable and not likely to live very long. The reason is....it was new, cool, trendy, sounded good in marketing, easier to draw tech talent that knows it and wants to work on it. The downside is...they now have a very large application written in technology that has been killed by its own vendor, and the path to upgrading to the new tech is very expensive.
It is still entirely possible to build super-fast, responsive, immersive websites today using ancient tech like the Common Gateway Interface, Apache, HTML/Javascript/CSS, with C++ on the back end. Tech written that way, and written well, can run circles around the bloated third-party-heavy slopped together crap that gets churned out for most websites. BUT nobody wants to use that old tech because it is harder to use (especially C++), takes longer to implement, harder to find talent who are willing to use it, and doesn't confer any buzzword bingo benefits to the marketing team.
So it IS true that tech gets reinvented every few years, and it IS true that everything that was written on the latest tech now needs to be re-written, but it is NOT true that things have to be that way (as there IS a category of old tech that would totally work and work well for these purposes and would avoid the need for re-writes every few years). Most companies just don't have the will to take that kind of long-term view.
Say "twenty-three-skiddoo" to logout.