But what if that older dev is only at par with the younger one: will she or he be treated equally, if everything else was equal? In other words, is an old person expected to compensate for her or his lack of youth by an excess of wisdom?
If the older dev is compensated more/has a higher level position, they are expected to provide more to the employer/product, whether it is through their excess wisdom or knowledge or responsibilities or otherwise.
They shouldn't be expected to compensate for their lack of youth in any way, as youth isn't a metric that has any relevance to their work in software development. And if they are of the same title/total comp as the young dev, there is nothing wrong with them being on par in terms of skills/knowledge/responsibilities.
I think there is a certain expectation that after 10-20 years in the industry you bring some added value a fresh grad won't bring. Surely you must have learned a few things, no? If not that's not a great sign.
Interesting thought though, what if the product in question is a product geared toward a younger audience that younger devs are more "in tune" with? Assuming they have more impact as a result.