That's absolutely NOT how it works in practice. It is widely studied that there are HUGE differences in programmer productivity. While the theoretical "10x" programmer may not be that common, I see "2x" programmers all the time.
But you hardly ever see 2x differences in salaries, even though this would be the fair thing if you were looking at output. Once pay becomes public, management is basically constrained to keep people in relatively tight bands because it's trivial for anyone on the lower end of a pay scale to complain that Programmer X gets paid more money, even if Programmer X gets shit out the door 2x faster.