Two people do the same job in the same building for different pay, and the gap is rarely a measurement of either of them. It is timing, a negotiation one of them had and the other didn't, a budget signed off in a year that happened to be good.
Pay is a number a system produced. Worth is something else, and the two only occasionally shake hands.
Deserving belongs to the second measurement. Asking belongs to the first.
They are separate skills, which is why so many people who are plainly worth more never get round to saying so out loud.