Traefik watches for these labels and configures networking accordingly. The labels mentioned are allowing all requests to erpnext-nginx container, overrides Host header such that all requests try to reach erpnext-nginx. This serves erpnext-nginx site for all requests irrespective of hostname typed in.
wherever traefik is installed as proxy add labels to erpnext-nginx container in the docker-compose.yml