Anatomy of the Engine

What Happens When You Type docker run

docker the command is just a client. The real work happens in a chain of daemons:

docker CLI ──REST /var/run/docker.sock──▶ dockerd ──▶ containerd ──▶ runc
 (client)                                 (API,      (container     (creates the
                                          images,     lifecycle)     namespaces/
                                          networks)                  cgroups, exits)
Note: This layering is why the OCI standards matter: images and runtimes are interchangeable. The image you build with Docker runs on Kubernetes, Podman, or any OCI runtime unchanged.
Danger: The client talks to dockerd over /var/run/docker.sock, and dockerd runs as root. Access to that socket = root on the machine. This one fact drives half of Docker security practice.