An IP address reaches a machine, but that machine may run a web server, a database and SSH at the same time. Ports tell the transport layer which process should get the data. You meet them daily when a dev server runs on port 3000 or a firewall rule opens only 443. Do not confuse a port with a protocol; HTTPS usually uses 443 by convention, but any port can carry it.