This is already supported in HyperV VM, and the concept is old: it is called ballooning.
Basically a driver in the Linux guest (hv_balloon for HyperV, but you have the same things for KVM, VMWare etc.) can artificially "inflates" its memory use when detecting too much unused memory and give it back to the host. When the guest needs more memory, the balloon driver will give the memory back. Couple with hotplug memory support and things can be pretty dynamic.
Not sure if they do something more sophisticated for WSL2 though.
I'm pretty sure the Linux side owns it's own FS cache. The whole point of this release is just to run a real Linux kernel in a VM in order to increase FS perf. I'm not sure how you do that and divorce it from the Linux kernel's FS cache.
Basically a driver in the Linux guest (hv_balloon for HyperV, but you have the same things for KVM, VMWare etc.) can artificially "inflates" its memory use when detecting too much unused memory and give it back to the host. When the guest needs more memory, the balloon driver will give the memory back. Couple with hotplug memory support and things can be pretty dynamic.
Not sure if they do something more sophisticated for WSL2 though.