Universal Control vs Sidecar vs Screen Sharing
Universal Control shares one keyboard and mouse between nearby Macs and iPads, but each device keeps its own screen. Sidecar uses an iPad as a display for a Mac. Screen Sharing shows another Mac's whole screen. To open one app window from another Mac as a window of its own, use an app such as Wormhole.