I think this is where society comes into play - Ideally I'd like to see the company expend a large amount of that value into wages with only a proportion of that going to developers and the rest being eaten off as taxes that can be put toward social programs to help the less well off.
We are in agreement. But if companies pay just market salary with no regard to value created, then they are not expending a large amount of value on wages :)
Your goal is to maximize the value delivered. Their goal is to minimize how much of the value you capture.
You’ll find balance somewhere in the middle.
And ultimately there’s only so much a company will pay if they can’t extract value out of your work. Regardless of how good you are.