There may be simplifications to this, but I suspect it eventually lands in a distributed system problem involving state and strong consistency semantics. I’ve done this for most of my engineering career and all I can say is that they are fun problems to work on because they are some of the most difficult ones :)
the revenue-driven decision was choosing to make the OS more like iOS, locked down with an app store, rather than macos, which allows third-party applications, browsing the filesystem, dropping into a terminal, etc. with built-in first-party support.
instead of making a computer in an AR form-factor, they made an iPad in an AR form-factor.
And it's easier and more power-efficient (because of hardware video encoding) to use screen sharing instead of sending drawing commands etc.
Assuming you're an engineer, have you thought about what handing over a "window" from one computer to another actually entails? CRIU can do checkpoint/restore at container/process level - but you actually want it to run on both, no? So you need to split off just the I/O, but at the OS-level per window.
Apple has been doing a lot of work in this direction and they have stuff that actually work (like video calls and to some extent windows. These are processes running on different OS-es with a matrix of hundreds of devices.
It's not something you vibe code over the weekend.