My comment was really kind of inaccurate, the difference isn't the memory ballooning, it's the special way WSL2 is able to interact with the host. It frees memory much better than normal Hyper-V VMs, and boots way faster than a regular Ubuntu VM.
Microsoft implemented a Firecracker style microVM (they call it "Krypton") for Hyper-V, which is used for WSL2, Edge Application Guard (run Edge in a VM), and Windows Sandbox. There aren't any real good docs on how to create one yourself using the Host Compute Service.