Its the same as any business. The business earns money by selling something and that goes to pay for the activities involved in running the business. The difference is that the workers get to share in the profits and success instead of just a small group at the top.
How pay is distributed is also up to the workers (owners). Nothing says it has to be equal. All this means is that the people doing the actual work get to make the decisions. Not some investor who only cares about profit.