Most people feel slighted when told that they're worse performers than someone nominally at the "same level" as them.
What is much harder to accept, and builds resentment and apathy, is something that feels arbitrary or unjust.
It's illegal to pay differently on the basis of sex, race, or other protected classes. It's perfectly legal to pay differently on the basis of performance or anything that isn't a protected class.
The vast, vast majority of workplaces in America pay people at the same level different amounts.
https://www.costanzo-law.com/google-hit-with-lawsuit-over-cl...
Perhaps the more productive worker is more productive because their work is not high-visibility. Maybe it's the arbitrary luck of having been assigned a more successful project.