How is heal check configured for Docker and Swarm providers

From the documentation it seems that services can be configured to perform health checks by periodically making requests to a given endpoint.

For example, a dynamic configuration using the file provider can be

## Dynamic configuration
http:
    service1:
      loadBalancer:
        healthCheck:
          path: /status
          interval: 10s
          timeout: 3s

For Docker and Swarm providers, we have various labels that we can use to configure the healthcheck

- "traefik.http.services.service1.loadbalancer.healthcheck.path=/status"
- "traefik.http.services.service1.loadbalancer.healthcheck.timeout=3s"

What is not clear from the documentation is how does Traefik interact with Docker Engine's own health check feature. One can write a docker compose file like

services:
    reverse-proxy:
        # The official v3 Traefik docker image
        image: traefik:latest
        command: --api.insecure=true --providers.docker
        ports:
            - "80:80"
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
    service1:
        image: some/image
        labels:
            - "traefik.http.routers.service1.rule=PathRegexp(`^/(data|more_data)`)"
        healthcheck:
            test: ["CMD", "curl", "-f", "http://localhost/status?"]
            interval: 10s
            timeout: 5s
            retries: 3

And if we use Docker provider, it seems that when a container is marked unhealthy by Docker, it is removed from the Traefik's load balancer rotation pool.

If we use Swarm provider, nothing happens on Traefik's side. This can be problematic if for example we are using docker's stop_grace_period option.

In both of this cases I'm not really sure how Traefik's dynamic configuration for a service ends up being regarding the healcheck. Is it completely ignored, and Traefik simple checks Docker's API?

The documentation is not really clear.