The top level networks section creates networks in compose (or specifies external user created networks) that can be used by various services. Each service then defines a networks section to identify one or more user created networks to join. That service gets automatically configured with a network alias for DNS based service discovery. This is the preferred method to setup networking with services, and by default each of these networks is a bridge network.

To skip that entire process, you can use a network_mode that changes from the compose managed networking to switch to host, bridge, none, service:$name, or container:$name. Each of these has unique properties.