In the olden days, web pages were built out of HTML (which is just plain text with tags in it). And then you used CSS to make it look nice (which is just plain text with curly brackets in it that is parsed and used to transform the appearance of the HTML) and a bit of Javascript (which is just plain text with curly brackets in it that is parsed and converted into machine code) to add interactivity to it.
Nowadays, web pages are built out of Javascript - because we expect web pages to act similar to native apps.
The page is often loaded as some placeholder HTML and CSS, then the rest is downloaded as a whole load of JS code. That code is then run and the Javascript builds the HTML dynamically in the browser. This means that instead of a few snippets of JS that need to be translated into code, there are whole apps that are downloaded, translated and then sit in memory for the duration of that page load. The whole cycle is then repeated (and sometimes cached, which uses up more memory) for the next page load.
This takes time, CPU cycles and RAM. Lots and lots of CPU cycles and lots and lots of RAM. And did I say it takes a load of CPU cycles and RAM?
(Also note that even if it's not a "web app" - if you're browsing a news site or other publisher, most of the adverts, beacons and other stuff, are written as huge globs of Javascript - they aren't there for interactivity, mainly there for analytics, tracking who you are and learning about your behaviour. These are also incredibly heavyweight - so a decent ad blocker may make a huge different to your speed).