>> But, that's the choice you make when you choose to work for free
Choice is a relative thing. A lot of developers go into open source as a last resort because they believe that it's the only way that they can get access to users. Corporations have a near monopoly over users.
Since we're on Hacker News, I'll point out that starting your own company is another approach, though it can also be a hard way to go.
Sometimes the real issue is that the market is very competitive and user expectations are high, which is the opposite of a monopoly, though it can still make it very tough to break in.
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.