I don't think most open source projects receive any donations.
But some open-source developers offer paid consulting or support services related to the open-source software they develop, to companies that use the software (see e.g.
SQlite).
There are also dual-licensed projects like the
Qt software library, where on the one hand it's available for free under the GPL license, but on the other hand you can also buy a commercial license if you're a company that can't or doesn't want to abide by the restrictions of the GPL.
All of the above only really works for open-source projects that are importantenough for companies to want to pay for them.
For the average Joe open source developer, the only common way to "monetize" one's niche open-source work is to present it as a "portfolio" to prospective employers to help you get hired for closed-source work.