Virtual Host is a mechanism of providing multiple hostnames(domain names) on a single server (IP Address). Thus, resources are shares including IP, Memory, Disk, CPU, etc.
This is possible with three ways:
Name based: Most used. This is possible because HTTP(1.1 onwards) request has HOST as one attribute (its not classified as header). Thus target server, using HOST(name) decides where to redirect the request. Issue: SSL, since SSL Handshake happens before sending the request. Another issue: Using IP Directly. (see https://en.wikipedia.org/wiki/Virtual_hosting)
IP Based: Each domain name (site) has separate IP address. Target sever has multiple network interfaces (NIC) each for one ip.
Port Based: Not common as not user intuitive.