If it’s the rule, everyone knows it. There is no guessing about randomness or hidden variables, and ultimately less favoritism than a line manager coming up with a stack ranking.
Looking at the larger picture, what otherwise tends to happen is that older people get pushed out. Then we have a massive issue of them ending up unemployed because nobody wants to hire them. This is compounded by the retirement age being pushed further and further away.
It's not about being fair to the individual, it's about producing a better outcome for society. In this case, saving money on welfare (that's also in great measured pooled across society, not an individual account).
Parents being able to take sick days to care for their kids, or 50yo being able to take leaves to take care of their dying 80yo parents are also unfair to kids in their 20s just starting out.
Then again, if we did have a random lottery that required all employees (up to and including the CEO) to participate, then perhaps we'd see fewer layoffs...
Newer employees often see this as incredibly unfair.