Native Docker Labels :- How do they work for networking?

I see in the docs that adding a label of io.rancher.container.network to a container launched outside rancher will enable it to join the managed network.

I am interested in understanding how this is actually implemented.

Is this triggered by monitoring docker daemon events on container startup, which is picked up by the rancher server, which then instructs the agent to change the network config of the container ?

I see the agent receive events like compute.instance.activated but cannot seem to find by looking at the code, as to how the managed network IP address is assigned to the eth0 interface in addition to the address it already has from the docker subnet.

Thanks
Shahed