The Age Discrimination in Employment Act forbids only discrimination against workers over age 40 in the US. It does not prohibit age-based discrimination against a worker who is under 40. Nor does it prohibit discriminating in favor of a worker over 40.
More generally, discrimination in employment is legal by default, unless a specific protected class is created by a specific law. Many classes of discrimination are legal, such as against smokers or obesity.
States and localities may have more restrictions than at the federal level, of course.
Ageism is a weird one from a discrimination standpoint. My understanding is that it's specifically defined (in the US) to prevent discrimination against those over 40
As an engineer in my 50s I've never personally been on the receiving end of ageism, but I've definitely seen extremely smart young engineers passed over for opportunities because they were deemed too young/inexperienced
And a lot of times that can be true, being young and gifted is amazing, but doesn't overcome years of experience in the trenches. Sure you may be able to work a 24 year old brilliant dev 80 hours a week and the 54 year old may want to leave by 6 every day, but if you hire right you'll get the same amount of work out of them, the 54 year old will just need a lot less effort to get to the same place.
I'm using age as a level of experience here. There may be 28 year olds I'd look at but only if they've been in management for multiple years with multiple teams under their belt, not just a single dev group that they got shuffled around on.
Discriminating against how old someone is is illegal, not usually how young, but this isn't discrimination because of an uncontrollable attribute, it's requiring experience outside of what being a team lead at a FAANG would normally afford you.
More generally, discrimination in employment is legal by default, unless a specific protected class is created by a specific law. Many classes of discrimination are legal, such as against smokers or obesity.
States and localities may have more restrictions than at the federal level, of course.