Well it's like this. If you're really good at developing a certain kind of software, you can write it and make it available to the public. Then if anyone else has something to add to make it better or extend, they can add it. Then instead of spending $100,000 on a propietary system, you can use an opensource solution for free.
So putting in 10% of my time to add to the opensource community is a fair trade for getting back 1000% from the opensource community.
It's a cooperative. Everyone benefits, that is, except for the firm trying to sell the $100,000 product that the programmers only really see a insignificant percentage of. This forces monopolistic competition - the largest companies have to reduce prices and offer a better product than the opensource community does. So customers benefit either way.