Open source software does not follow basic economic principles: people contribute sometimes considerable time and effort to the development of a product and then agree to provide it for free to anyone who wants it. In some cases, employers even encourage their workers to participate in such endeavors. Why?
Participation dynamics in open source are extremely complex. David and Rullani study the participation of over 200,000 individuals (!) on SourceForge and argue that once critical mass is obtained, people want to help for the common good. Spiegel argues that participation allows to signal about one's qualities, and thus be hired on other projects. Bitzer, Schrettl and Schröder argue that there can be intrinsic motives for participation beyond signaling. Another aspect that drives participation is the knowledge that your contribution will remain in the public domain.
The amazing thing in open source is that the delivered product is often superior to commercial ones. The prime example in Linux, which easily surpasses market dominator Windows in security, efficiency, functionality, and, of course, price. Windows users: with Linux, you do not need anti-virus software clogging your memory, no need to defragment your hard drive, no need to reboot for minute updates, no worries about the computer crashing, and no need to buy any software. Speaking of software, products like LaTeX (already discussed here), emacs, apache, and MySQL dominate corresponding commercial products. Beyond the software industry, open source collaborations on sites like Gutenberg, Wikipedia, or Youtube that show that there is a place for the public good.