When you purchase hosting, you receive access to a portion of a web server along with resources such as storage, CPU, RAM, databases, bandwidth, and other features depending on your plan.
You connect your domain to the hosting server using DNS or nameservers. Once the DNS configuration has propagated, visitors can access your website through your domain.
For example:
Domain: example.com
Hosting: Stores your website files
DNS: Connects your domain to the hosting server
SSL: Enables secure HTTPS connections
Website: The final content visitors see