A critical problem that exaggerates the "ageism" is people who sit in the same corporation for 15-20 years, get laid off because companies change, and haven't refreshed their skills for many years. I saw my spouse go through this last year. She got laid off from the company where she'd worked in a variety of roles for 13 years. Her field toward the end was product management/ownership, and she liked it, but she didn't like Agile - she'd had bad experiences at her employer with careless engineers using "agile" as an excuse to have no process and no oversight. She had also spent many years developing deep domain experience in a narrow specialty (international e-commerce). She could find generic PM jobs easily enough, but they didn't exercise her domain experience and they didn't want to pay her what she'd been making just to be a generic PM. It took her six months to find a new job that uses her domain expertise (educating herself about Agile along the way).
For people less determined and hardworking than her, the problem can easily be much worse. If you've done nothing but Microfocus Cobol for the past 20 years and suddenly have to find a new job because you employer finally ditched that antique piece of crap, and you aren't interested in learning how to do something modern, you're in a world of hurt.