Money is just a convenient abstraction of time and energy. Basically everyone, all the time, is focused on min-maxing their time and energy (optimally is another question, hah). These are both fundamentally scarce things and likewise have intrinsic value to everyone.
If you spend time reading an article or watching a YouTube video, it defacto has value to you, and the creator of it spent both time and energy making it. And just like that, there is a market.
Nothing stops creators from self-hosting and absorbing the full cost themselves.Yt doesn't even care if you link to your own hosted version of the video on their platform.
Remember right at the start: "There's no reason you can't abolish login walls while still serving ads." This is how youtube works.
X is the one blocking or messing up views without accounts (and also being too likely to ban accounts that don't give a phone number).
Though most people posting on youtube are doing it for free or negligible revenue (I'm not sure how it works out on a per-view basis), and a lot of the rest make almost all their money elsewhere.