But in the real-world, there are lots of examples of dead-weight or people who keep their job despite having limited (or even negative) value. Sometimes this is the result of weak leaders unable to bring themselves to fire people, sometimes it's because the litigation risk is too high. On the opposite end, there are lots of examples of people who accept jobs below their cost-of-living (those living off debt, for example).
If you are the single possible candidate for a job that is essential for the company, then you can use your monopoly power to get paid more than the “value” you bring.
If the company has an excess of candidates, they may be able to pay less than “CoL” (because CoL varies per applicant, and the minimum is someone in poverty not a standard engineer lifestyle).
I do agree with your statement as a generalisation. Although the maximum a company will pay is usually nowhere near the value you might bring (Apple average pay $150k, Apple average excess profit per employee $300k).
In that scenario your value to the company, together with all the other "essential" budget items, is the total value of the company. If you're somehow getting more than that then the company simply doesn't have the budget to pay for all the essentials and is consequently going bankrupt.
And even in non-software based products and companies industries this might be hard since the output of so many teams gets lumped together and sold as one product. What's the value of the team that creates and markets the MacBook Pro Touch bar? Personally I think it is net negative, and maybe there's even division over that within Apple.