Let's consider jQuery is an example project for my question.
It is obvious, that to carry out such a well-performing and important to overall industry project would be very expensive, if done by a commercial company. But I also fail to beilve it was just a few people, that have decided sitting in a cafe, that they are to build jQuery solely for popularity's sake and donations.
How do creators of jQuery, for example, monetize their development effort? Same applies for Browser vendors, like Mozilla Foundation. What's they are in for?
I believe Mozilla get their money from Google because it's their browser's default search engine. Chrome is similar, though the relationship with Google is obviously much closer ;-)
jQuery was started by a guy called John Resig who just wrote it to help his own development. Remember, it wasn't always as huge and powerful as it is now, so the initial work wasn't as expensive as creating the whole thing would be nowadays.
Mozilla Foundation for example gets tons of money from Google. The Apache Software Foundation gehts a huge amount of donations from these people: http://apache.org/foundation/thanks.html We are speaking of huge amounts of money here.
In case of jQuery, look here: http://jquery.org/sponsors/ Of course, most people in these foundations are not paid. F. e. the ASF does not pay a single developer. Many developers in open source projects do it because it is fun. And it is good on their CV. People who are experts with jQuery do get some good jobs indeed.
If you found a company with the open source model, you need to pay your developers. For example, IBM pays people to develop OpenOffice.org, even when it is an Apache Software Foundation project meanwhile.
Why? Because they can sell Support to their customers. Or trainings.
Many companies who develop open source products give support and traiing, or additional It is the way big cos like Red Hat work or even smaller companies.
But yes, basically most projects start with a few hackers sitting in a cafe and having an idea.
Please have in mind that sometimes you could think that an open source foundation like the ASF is somehow a playground where different companies can play together without much politics. Because at the ASF there are individuals only, not companies. If these individuals are paid by companies... no problem. Please be aware the the ASF is very carefully about project independence from companies, even when my comment didn't read very much like that :-)