Ageism is an interesting thing. When I was at Google I was certainly pulling up the median but I didn't feel particularly singled out (perhaps after having to pay Brian Reid that sort of stuff got stopped), but it is a place that many people accuse of ageism. I saw something different.
One of the engineers at Google mentioned at lunch an "insanely great" idea they were working on which involved RPC protocols. Having been pretty deep into the RPC wars of the 80's I was naturally interested. His 'insanely great' idea was a self describing protocol, not unlike ASN.1 but with python interspersed. I mentioned that such protocols were quite popular in the 80's with the whole 'distributed objects' meme that was going on and they all largely vanished, but I would love to hear how his was different. Turns out it wasn't different, and his anger at having that wisdom imparted was directed to me, not toward his cool, albeit not exactly new, idea not being practical at scale [1].
Now was he being ageist? I don't think so, just being a kid. Nobody likes to find out that their idea is not novel or workable. People fall in love with their ideas. And a lot of older engineers who I know who have found themselves on the 'outside' of their employers correlate strongly with stories about how the engineering team was re-inventing some wheel.
Understanding that mechanic lead me to conclude that engineers love to create, and as they get older they have been exposed to more and more things. That means the number of new ideas they see starts getting lower and lower as a percentage of ideas proposed. How they respond, often strongly affects how their peers perceive them. If they point out that the wheel is being re-invented and the old wheel is still good enough, they are often perceived as 'stuck in their ways and unwilling to change.' Whereas if they can bring up the issues that were challenges in the previous implementation and solicit help in over coming them, they look visionary.
Problems can occur when a younger engineer gets promoted to 'manager' or 'lead' and they are in a position where they are responsible for a project. Sometimes like a young lieutenant fresh out of OCS they don't know how to trust their Sargents to get things done, they force a process or a course of action on them which is recreating a wheel. That is where things get ugly as the 'greybeard' pushes back and the manager, not having the skills or wisdom, feels threatened and pushes harder. Usually the older guy gets moved out of the group so that it can go fail (or succeed) on its own.
Any well managed company can, and does, apply the skills and talents of anyone qualified to work, regardless of their age.
That being said, from the energy perspective when you pass 50 you come to realize that there isn't a lot to be gained in killing yourself for someone else's benefit. Folks who would take advantage of that, and some VC's do, will avoid you for that reason and argue against hiring folks who understand that truism.
[1] One of the challenges of so-called 'intelligent' protocols is that they impose a compute burden on the endpoint just to see if they are actionable. Historically that has mean that higher transaction rates become compute limited before the the rest of the system, thus wasting resources. Saw an interesting pitch for a TCP Offload engine that could do the execution but the transaction rate limit is a killer at scale.