Why would someone use his own time to develop an open-source project for free and without compensation?
For small projects, reasons might be "hobby", "getting some experience", "fame", "joy" etc. but that's not how the big open source projects like Mozilla, OpenOffice, Linux work.

Why did Sun buy StarDivision and made StarOffice an open source program (called OpenOffice.org)? Why does Mozilla create a top-notch browser and give it away as open source? Why are there people creating Linux, writing drivers and whatnot, and make it available to everyone for free? Why does Microsoft create opensource drivers for Linux so it can run better in MS's virtualisation?

Because it makes some business sense for them. They make money that way, or at least plan to.

In some cases, the dominance of MS's products, i.e. Windows, Office, Internet Explorer, was the reason the create a competing product, so it would be harder for MS to use their desktop dominance to conquer other domains, i.e. servers, internet services, too. This explains, to some extend, OpenOffice.org and Mozilla.

In other cases, open source software is meant to drive sales of hardware, other software or services. Open Source drivers obviously help to sell hardware components to Linux users. RedHat sells support for their Linux distro, and they sell the fact that their Linux is genuine RedHat. Other products, e.g. Oracle, are certified for use on Redhat, but not on CentOS, even though it probably runs just-as-well. Server hardware is certified for Redhat, even though other linux distros probably run just-as-well. Big-money-clients don't care about the price, they want the certificate.

Some companies, e.g. Google, sponsor many open source projects, because it helps their business. They don't do it for altruism. They want a free internet, a pervasive internet, a widespread internet, where people use Google's services so Google generates revenue.
