Containers get their own network through namespaces, and you can make one by hand. That is useful when you want to see how a program behaves with no network at all, or with a network you build piece by piece.
ip netns add test1
ip netns exec test1 ip -br link
ip netns exec test1 ping -c 1 127.0.0.1
The new namespace starts almost empty: a loopback interface that is still down, and none of your real interfaces or routes. That ping fails until you bring lo up with ip netns exec test1 ip link set lo up. Any program you start with ip netns exec lives in that bare network, while its files and processes are the same as on the host.
I find it a neat way to check what an app does when the network is completely gone, without unplugging anything. You can also connect the namespace to the host with a veth pair if you want a small private network between the two.
List and remove them with:
ip netns list
ip netns del test1
These commands need root. ip netns only sees namespaces that were created through it, under /run/netns; the namespaces Docker creates for its containers do not show up in that list. For those, lsns -t net is the better overview. A namespace you add by hand also does not survive a reboot.
Further reading: ip-netns(8) manual page, network_namespaces(7) manual page