Nmap determines if a port is 'closed' by sending a connection request to the port and waiting for a response. If the port is accessible but no application is listening on it, Nmap receives a TCP RST (reset) packet in response. This indicates that the port is reachable but closed, meaning there is no service actively accepting connections on that port.
