Zoom uses a proprietary gnome API / hack to do it I believe. It works on Gnome only. Note that with pipewire, wayland screensharing already works on Chrome/Firefox (for all of the video chat apps), and it will come to electron eventually. I imagine in a year or two screensharing on wayland will become seamless for most things.
If you know how to make that work I’m all ears. I run Debian testing, wayland, gnome. I tried to screen share yesterday and got a popup about how its not supported. Maybe mu zoom client is out-of-date?