What is required from the script, and webpage, to load a website - before showing any content?

What is required from the script, and webpage, to load a website - before showing any content?

Websites nowadays are loaded before they open. This is either done with a progress bar, or a logo that pulses and then reveals when the webpage is ready. My question is how do you 'load'  a website. I have heard of Ajax Load and Barba.js but as I am starting out, these topics (Barba.js) are difficult to grasp. I just wanted to check that this was the way forward for such a thing. I did try Googling it, thinking someone would have asked that before, but all the results contain is just how to make a progress bar, or div that fades on page load. No actual article about just what you are asking the browser to do, before the content is loaded to the page.

I am looking some guidance on how this can be done.

Thanks, David