It's essentially a min-max problem. Optimization is achievable, but hard work.
It demands honesty from both parties and any employee must understand exactly what you said: companies can't give all the employees want. You have to know your own value and make yourself valuable to the company first, then ask for recognition.
The Pink Floyd song put's it well "When you ask for a pay rise it's no surprise they giving none away".
What does work for getting a pay rise is:
1. If you are genuinely paid less than market then prove it by getting an offer from another company.
2. The other option is to get promoted into a new role. As a developer that usually means becoming a manager - so even if you could add 10* more value as say an "architect" it may be more profitable personally to become a manager.
There may be other more 'ruthless' ways too. I am not ruthless enough to know about them!
But all in all value and pay are roughly correlated but increasing one doesn't necessarily increase the other.
It demands honesty from both parties and any employee must understand exactly what you said: companies can't give all the employees want. You have to know your own value and make yourself valuable to the company first, then ask for recognition.