I think part of this is that, obviously it is totally fine to discriminate based on age. Children aren't allowed to work, vote, buy certain items, etc. You're also not allowed certain public offices if you're too young.
The difference is that we can conclusively show that children are intellectually under developed.
Old people are often just as intelligent as their younger colleagues, and often wiser as well. Of course there are exceptions, but there are poor performers at every age bracket for a variety of reasons.
I'm not sure why you're being downvoted. I'm fairly sure this is the correct reasoning. We generally think it's acceptable to discriminate on the basis of age in many contexts, one of the most important of those being experience. If you are selecting candidates with more experience or "maturity" than is possible for someone of a particular age, you are effectively discriminating by age.
Perhaps people have morphed their internal definition of the word "discrimination" into something that differs from the dictionary and therein lies the objection?
Let's abolish these discriminatory labour laws.
If a child can go to school he can also work, why rob 8 year olds of this opportunity & force them to school when they could be working in a sweatshop?