A single instance of Apache or Nginx (and probably most other HTTP
servers) can handle multiple names on one port at one IP address. We
use this ability a fair bit at my work: the web server determines what
name you're looking for from the incoming header, looks at its own
config to find out where on the box that website is stored, and responds
with the proper information. The most obvious implementation of this is hosting sites who have used this ability for around
20 years.
Presumably similar things can be done
with most other incoming services, although I'm most familiar with the
behaviour of web servers.