Docker on Mac runs in a VM, either by one of the traditional virtualisation solutions (Virtualbox, VMWare, Parallels) or via xhyve. The VM acts as a Docker server, so the client on the mac side just passes options to the Docker VM. See:
https://docs.docker.com/engine/installation/mac/