They do indeed generate revenue.
For someone at least, even if it's only the ad-space brokers. Mostly how it works at the site / page end of things is that, for every advert that is viewed, the site gets a fee for hosting it and, if it is converted (anything from simply being clicked on to a sale made as a result), they get an extra payment.
Then there are the payments due for either receiving analytics data from the site or else allowing the advertiser(s) to place analytics on the site ... or via a third-party supplying the advertising mechanism on the site (who pays the site for the privilege of doing so).
Other options include
1. making a tax loss / writeoff — in which case the last thing the site / advertiser cares about is generating revenue (and, in fact, would rather not)
2. money laundering: place some adverts with a broker owned and run by someone within the ‘group of companies' and have them purchase services from yet others in the same group of 'business associates' and watch the money become legitimate before it is returned to you in the form of 'sales'.
There are all kinds of ways to make money from online advertising ... it's huge business (look at Google, after all).
The barrage of ads doesn't lose viewers, no.
Those who dislike them for various reasons ... often due to privacy concerns associated with tracking and profiling ¹ ... use adblockers and never even see them in the first place ².
Those who do not install blockers clearly do not take (that much) offence to them ... or they would go sufficiently out of their way to learn about, and install, blockers.
So, either way around, nobody is offended by them.
As a sidenote, if you saw popups / popunders on the page when you visited it, your browser settings need looking at — web browsers have blocked popups / popunders for between ten and twenty years now, so, check your browser's privacy and security settings ... (which, if it wasn't already, is now, after reading the footnoted posts, Firefox of course 😉)
—
¹ https://whereangelsfeartotread.medium.com/brideshead-reanalysed-e88b6e5c0859
https://whereangelsfeartotread.medium.com/i-know-where-your-children-are-a891a44065a1
² https://whereangelsfeartotread.medium.com/www-rong-de90cdb23b8c
https://whereangelsfeartotread.medium.com/www-rong-29749a6dec22