"Docker" is really several cooperating pieces, and knowing the split explains some otherwise-confusing behavior:
docker) — the command you type. It doesn't do the work itself; it sends requests to the daemon.dockerd) — a background process (usually running as root) that actually builds images, starts containers, manages networks and volumes. The CLI talks to it over a socket.containerd-based clusters).Practically, the layering means docker run is a client request, not a self-contained action: docker (client) talks to dockerd (daemon) which talks to containerd which talks to runc which does the actual isolation. This is also why the daemon needing to restart (a Docker Desktop update, for instance) can interrupt containers even though you never touched them directly — they're managed by a process independent of your terminal session.