Forget tech for a second. In any job type, isn't it a pyramid. There are lots of junior roles, slightly fewer senior roles, fewer again manager roles, only a few senior manager roles etc. Isn't that just a natural part of any team's makeup. You only need one leader for a team of 5-10 people, etc. I've witnessed this team structure at every single company I've worked for (and as a contractor for 10 years, that is a lot), if you want to progress up to the next level there are always fewer jobs available.
Doesn't that mean that as you get older, competition for the job at a seniority that matches your age become increasingly difficult. The number of people doesn't change.
Not everyone can progress up the ladder when the ladder narrows as you go.
This isn't ageism is it? It's just the natural lower demand for more senior people.
And I guess what follows from this is the people who fail to move up, and try to stay at their current level are then also competing with the people below them who are trying to move up.