They scan certain ports as well, which can provide them with 'fingerprints' as to what's running on those ports, which can then invite further investigation.
If ports 80 or 443 are open and there's a web server fingerprint (Apache, nginx, caddy, etc) then they could use further tools to try to discover domain names etc.