> discrimination not truly based on age, but on stagnation
I can't speak in general, but I have observed in my circles that this is at least somewhat true, and for altogether natural reasons.
Most people, once they hit their late 30s or 40s, family (if they have one) takes priority and they don't have as much time to dedicate to going to Meetup groups, conferences or late nights spent gaining proficiency in new technologies. In general having kids vastly reduces one's free time.
Knowing a technology deeply requires many hours of intentional practice, commitment and energy, which many if not most people in that age range with families don't have a lot of at their disposal. Their "tech growth rate" slows down considerably relative to when they were in their 20s.
For example, I've noticed many SQL DBAs of a certain age have a hard time learning distributed databases because they often expect something familiar (databases are databases, right?) yet find themselves having to bone up on so many new concepts (that CS degree was so long ago) that many give up. Only the truly dedicated, truly passionate and truly nerdy persist, but they are in the minority. A common refrain heard is that "there's just too much new stuff coming out all the time, you can't learn everything", which is true, but it's often also an oft-employed excuse for not dedicating oneself to being current.
So when most average tech folks hit 50, they have pretty much lost about 1-1.5 decades of high-rate tech learning.