Docker on macOS also runs a Linux VM under the hood, just like WSL2 does, they're no different in that respect. WSL1 used the more exotic approach of translating Linux system calls to and from NT kernel system calls, but for various reasons (compatibility, performance, complexity) Microsoft abandoned that technique and adopted a Linux VM running under the Hyper-V hypervisor for WSL2.
WorldMaker|7 months ago
(Also, WSL1 isn't as actively maintained as it was when WSA [Windows Subsystem for Android] was an active Windows 11 feature driving it, but it hasn't been entirely abandoned either and there is some community support ongoing [open source PRs].)
[0] Among other things, Windows likes to run itself at all times as a guest in Hyper-V when Hyper-V is active (and other ancient hypervisors aren't interfering), making Hyper-V VMs like WSL2 "peers" with Windows itself for Hyper-V resources/attention. (It's one of the funnier things about Hyper-V being a "Pro" feature still today because even consumer-focused Windows Home is often still running in Hyper-V [because it's also sometimes a defense-in-depth security/sandboxing in some consumer use cases], it just won't let you configure other VMs in it than your main Windows OS.)
zanecodes|7 months ago