Plus there’s a GLUT of fresh grads joining each year.
Graduate -> Software Engineer -> Senior Software Engineer -> Team Lead -> Non-Technical Manager (???)
Then again, unless a company is scaling at the same speed as your career, you're eventually (probably before 40) going to hit a wall where there's no higher level for a tech person to go, because there are no bigger problems to solve. If you want to earn more money or get more recognition, you're going to need to move to another company which can offer harder challenges.
The various systems, incentives, lies - ALL, arise from the growth paradigm.
That paradigm depends on more cheap, energetic fresh meat arriving out of college/recruiters every year.
Fresh grads cost less, have relatively more energy, fewer ties, and probably better cognition responses.
They lack experience, but that's a solvable problem.
The question to ask is this: Why WONT there be work place discrimination, when younger, cheaper candidates show up every day?
System incentives are not in favor of growing old in tech.
And whats laughably worse about this is that humans are TERRIBLE at making out correlation from causation:
people will eventually associate youth with tech work, so an OLD person doing tech - will be tagged as an outlier and assessed on that.
(And Firms would NEVER admit that its just easier for them to ignore work place equality issues in favor of "fit" and "cultural match")
There's a limited number of those positions, inherently. So most of the people in an age group are probably leaving the profession altogether, not moving to management.