Ports are how a single IP can run dozens of services simultaneously. The combination of (source IP, source port, dest IP, dest port, protocol) uniquely identifies one TCP/UDP flow.
Ports under 1024 are "well-known" and conventionally require admin privileges to bind on Unix. Ephemeral ports for outbound connections are picked from the upper range (typically 32768–60999 on Linux).
See also
