Most Linux admins assume they know which TCP/IP ports their servers expose, until a scan reveals something unexpected. A database port listening on all interfaces, a forgotten development service, or a management interface that was meant to stay internal can easily appear once you look from the network side. Port scanning is the process of probing a system to see which ports respond and which services are reachable, giving administrators a clearer view of the system's real attack surface.

Source: Port Scanning Explained: Tools, Techniques, and Best Open-Source Port Scanners for Linux