JavaScript loading & execution
Scripts download, parse, compile, and run. The cost is everywhere.
Each <script> the parser encounters needs a download (unless inline), a parse, a compile, and finally execution. By default scripts block parsing; defer keeps order but waits until parsing is done; async runs as soon as it lands. Choosing the right attribute is one of the most impactful perf decisions in HTML.
Once executing, the script can read and mutate the DOM, register event listeners, kick off more network requests, and trigger style recalculations. JavaScript is the only resource that can read and mutate everything in a page, which is also why it's the easiest to misuse.
Takeaway
JavaScript is unique: it runs on the user's CPU and can change everything. The bigger the bundle, the longer the user waits for interactivity.