Website hosting refers to an online server that allows you to publish a website on the Internet. Basically, it's like paying rent for space on a physical server to store all the files that make up your website and ensure that your website works properly. Web hosting occurs when the files that make up a website are uploaded from a local computer to a web server. Server resources (RAM, hard drive space, and bandwidth) are allocated to the websites that use it.
For a website to be accessible to everyone, it must be stored on a server that is connected to the Internet. When someone wants to view your website, they'll type your URL into their browser and their computer will connect to your server. Once this happens, the server will send them the files that make up your website.