on X11, if, and only if compositing is enabled, switching to a different virtual desktop does not unmap the windows from the previous desktop. i suppose this is simply a result of it being (supposedly) unnecessary, as the compositor takes care of hiding the out of view windows. it also has the nice side effect that switching is rather instant. however, it has the rather unfortunate side effect that applications don't know that they can stop repainting their windows entirely, so it causes a rather significant resource consumption problem. my go-to example for this is viewing https://www.wetteronline.de/wetter/berlin in chrome, which eats lots of cpu and gpu. this is sort of the same as closed bug #431242.
Terms on wayland are different, windows do get notified via both limited frame callbacks and an occluded state. What apps do with that is on the apps
why would i care about wayland? it sucks, in some points by design, and i'm going to resist switching to it as long as feasible. and on x11, this is a regression introduced by a specific compositor implementation. i expect somewhat more convincing arguments for keeping it that way.