A port number is an address for some Transport (OSI layer-4) protocols: TCP and UDP. Host processes bind to TCP or UDP at a particular port number, and the transport protocol sends any data destined for that port number to the process bound to that port number.
An important point is that the ports used by TCP and UDP are different, even if they are the same number: TCP port 1234 is not the same as UDP port 1234. Only one host process at a time can bind to TCP port 1234, but another process could bind to UDP port 1234 at the same time as TCP port 1234 is being used by a process.
Not all transport protocols use port numbers. Some use something else for addressing, and some don't use any addressing.
NAT (Network Address Translation) will change the IPv4 packet source, destination, or both addresses, but that requires an address for each address translated. NAPT (Network Address Port Translation) will also translate the port number for TCP or UDP, allowing multiple addresses to be translated to a single address.
RFC 2663, IP Network Address Translator (NAT) Terminology and Considerations explains:
4.1.2. Network Address Port Translation (NAPT)
NAPT extends the notion of translation one step further by also
translating transport identifier (e.g., TCP and UDP port numbers, ICMP
query identifiers). This allows the transport identifiers of a number
of private hosts to be multiplexed into the transport identifiers of a
single external address. NAPT allows a set of hosts to share a single
external address. Note that NAPT can be combined with Basic NAT so
that a pool of external addresses are used in conjunction with port
For packets outbound from the private network, NAPT would translate
the source IP address, source transport identifier and related fields
such as IP, TCP, UDP and ICMP header checksums. Transport identifier
can be one of TCP/UDP port or ICMP query ID. For inbound packets, the
destination IP address, destination transport identifier and the IP
and transport header checksums are translated.
Understand that the TCP and UDP port numbers are separate. TCP will not be translated to UDP, or vice versa. A TCP segment using NAPT will have its port number translated to a TCP port, and UDP using NAPT will have its port number translated to a UDP port number, even if they are the same number. The same number can be used simultaneously for TCP and UDP because they are separate protocols.