Nearly everyone builds their software on top of open source libraries, so the beneficiaries or "free riders" if you prefer include both lots of other programmers and the end users who download their software.
But, that's the choice you make when you choose to work for free and give away your stuff. Isn't it a bit weird that we expect anything else? And yet occasionally it works, you can sometimes capture a small fraction of the value through Patreon or whatever.
If you want a less precarious income, there are jobs working on open source software. The 200th most popular open source developer probably works at Google.