If someone aged 42 is only as productive as someone aged 22, it's perfectly reasonable to offer them only the same salary for the same job.
Of course, unless the person aged 42 has wasted 20 years of their careers (which, I concede, some have) it is highly unlikely that their productivity is really still the same.
A 42-year-old developer who has 5x the productivity of a 22-year-old developer and much more general business experience as well but only wants 3x the salary is a steal, unless you're only looking at the $$$.
As they say, compound interest is king - companies are just not willing to swallow the fact that the compound interest is in this case working against them. And yes, it’s working against employees as well: after all, no amount of technical experience can fight against 20+ years of compounded interest.
EDIT:
A $60k starting salary, compounded annually at 4% for 20 years, will be $131k. At the age of 50, they’re knocking on the door of $200k. 60 brings them to around $290k. Just by doing their job.
If anyone is to blame for the “unnaturally high” salaries of those over 40, it’s the companies themselves, plus a bit of math.
The only part that’s tied to your perceived value and leverage are bonuses or new job salaries (and most of the time those are tied to your previous salary). I’m not counting bonuses, and getting over a 20% increase when switching jobs is a startlingly rare event reserved for CEOs and the Guidos of this world.
Also, if you have concrete examples to the opposite, I’d like to hear them. Simply claiming repeatedly that they are merit based does nothing to sway me to your position.
In fact- at Amazon I've heard the opposite of what you're claiming (I've heard this sort of culture referred to as 'up or out')- after a few years you've exhausted your signing incentives (primarily stock options that vest over those few years) and if you stay in the same role for a long time, your total comp will actually decrease
Out of curiosity - don't companies take a pass on older candidates because they expect them to ask for a higher salary than the younger ones?
So now we've hit the real root of the problem. If you expect significantly more money than competitors in your role- than ageism may not be why it's getting harder to find jobs.
It isn't 'ageist' to disagree on the value of prior experience.