TCP port 25 is used for SMTP, the protocol that moves email between mail servers.
A port is a transport layer number used together with an IP address and a protocol such as TCP or UDP to direct traffic to the correct service on a host.
A server process binds a socket to a port and listens, while a client typically chooses an ephemeral source port for outbound connections.
The combination of source and destination IP addresses, source and destination ports, and the transport protocol uniquely identifies a flow so the operating system can keep many conversations separate.
Firewalls, NAT, and scanners talk about ports because the destination port is the stable rendezvous point that exposes a service to the network.
A sending server opens a TCP connection from an ephemeral source port to a receiving server on destination port 25, completes the handshake, and then exchanges SMTP commands to transfer a message to the next hop.
Port 25 is primarily for server to server relay on the open internet.
End user clients and applications usually should not send mail directly to random servers on 25, which is why message submission is typically done on port 587 or 465 with authentication.
Because abuse is common, many networks restrict outbound 25, and misconfigured servers that accept unauthenticated relay on 25 quickly get used for spam.
When you see 25 exposed, the key question is whether it is intentionally a mail exchanger and whether it is hardened, patched, and configured to refuse open relay.