Hosting Is the place where the website , its files and database. Domain Is the name of a website on the Internet.
For the site to work properly, you need both hosting and a domain. These are two separate services, they are ordered and paid separately.
The main task of a domain is to direct site visitors to the IP address of the server that hosts this site.
When you enter the domain name in the address bar of the browser, the browser using the system DNS converts the domain name into the server's IP address, after which it addresses the server directly using the received IP - sends a request and receives a response to it. The response to the request can be site pages, images or other data.
The domain is also responsible for which mail servers should accept incoming mail, and can be used for other purposes, such as verifying ownership of a domain or site.
The main purpose of hosting is storing site data and providing tools for the operation of its internal logic (launching scripts, interacting with the database, etc.). A certain amount of disk space is allocated on the hosting server, where you can place site scripts, its content, templates, plugins and other data. The hosting server accepts requests from site visitors and returns the information they need.
Hosting site Is a virtual host: a collection of certain server settings and a separate directory for storing its files. If the hosting hosts several sites at once, each of them will have its own virtual host with its own settings and a separate directory for files.
It is for the virtual host that an SSL certificate is installed, redirects are configured, etc.