ports of the equipment connected to a given network, see if they are open, check the available services on these machines, or evade their firewalls.
For these reasons, even though Nmap is a tool that is designed to improve network security, its features also allow you to use it to take advantage of network vulnerabilities. This is why it it is a program that is used in the hacking world.