I watched a talk by Bob Martin in which he claimed that the number software engineers in the world doubles every 5 years. For a huge majority of those new engineers, it's their first careers. Thus, almost half of the world's software engineers should be between the ages of 22-27. So, tech companies are dominated by the young not because they hate old people, but because there are so many young people with technical skills and that number is growing rapidly.