It used indeed to pay for the content. But the amount of money paid to the websites decreased so much in the past few years it's not the case anymore. These days, advertising is mostly only worth it for clickbait article generators. Every website with a few employee with actual content you see on the internet has at least one or two other ways to get money because advertising is not paying enough these days.
Take a fairly well respected tech publication like ArsTechnica. Their revenue is almost completely based on advertising[1] to the point that they experimented with blocking people using ad blockers[2]
They are absolutely not representative of the average website, it's a massively popular website (look at the Alexa rank) and of course advertising works for this kind of websites because you have some leverage to negociate. I'm talking about the majority here. (And even them started to try paid membership, it really tells you the current state of advertising.)