It's that fast because it uses a declarative model and this ends up being very efficient for a variety of use-cases
(I say this speaking from a NixOS laptop; Nix operations are invariably much faster than alternatives, like Docker, assuming you have the technical chops to get them to work)