That is why I mentioned incentives. To make it more precise, assuming everyone works to the best of their abilities, people should be compensated in proportion to the time they work, not the output of their work.
This assumption doesn't always hold.
Employee and employer might agree to share the value created which is not always a function of time spent working.
Value sharing is a basic framework for compensation negotiation. Employee wants to get all the value derived from own contribution. Employer wants to pay absolute minimum employee is willing to accept. Paying more than derived value doesn't make economic sense, so compromise will be somewhere within this range. If acceptable minimum is below the derived value, compromise is impossible. Time spent working is a free variable in all this.