The software tries to maintain 8 outbound connections and allows up to 125 inbound connections. When you’re behind a firewall and can’t receive inbound connections, you can still use Bitcoin fine with just outbound connections. But allowing inbound connections helps the network.
Nodes remember addresses they’ve seen and share them with other nodes. This is how new nodes find the network and how the network stays connected.