When a single server serves pages for many websites, each with its own domain name then this type of hosting is known as shared hosting.
What happens is that some small companies do not want to use their resources to host their website on a dedicated server, as it requires a system administrator and the companies want to save their own time and money.
How it works:
What Is Shared Hosting?
Name based hosts are not compatible with old browsers that do not send the host name as part of the requests. For example, the older HTTP/1.0 browsers that were not upgraded cannot send the host name as part of their requests. They also do not support HTTPS websites, as all name-based hosts using the same IP must share the same digital certificate. A TLS extension gives a way for the client to provide the host name as part of the handshake'. If the DNS or Domain Name System is not working properly then the name based hosted website is difficult to use and using an IP address in the address bar would not work as many website are sharing same IP.
Web hosting can be done by two methods; name based hosting and IP based hosting. The name based hosting uses a single IP that is utilized by different host names/web sites. When a browser requests a web page from a server using HTTP/1.1 then it also includes a host name that is used for finding the web site that can then be delivered to the user.
The companies lack control over the server as the server is shared by many, so they cannot ask for extra privileges. There is an added threat of insecurity as the shared server might not always be secure. On the other hand, one can save quite some money and time by using shared hosting. No system administrator is needed as it is a shared hosting.
Advantages and Disadvantages:-
IP based hosting has the advantage that each host has its own IP address. This helps the sites to use their own SSL certificate, which helps in increasing the security. In contrast to name based hosting method, where there is only one IP address used by all the host names/web sites. Many people/companies prefer IP based hosting method because of the above mentioned reason. Many servers are changing their web hosting method to IP based hosting as it offers much more security then name based hosting method. But one important thing to remember about shared hosting, no matter which method is used, is that they are always a bit insecure.