Universal Control lets you move from iMac to MacBook when they are side-by-side, moving your mouse from one Mac's screen and onto another's. Keyboard works, too.
Universal Control is turned On in MacOS Tahoe and this is a mind-bending experience. Drag from Sequoia (left) to Tahoe (right) and double-click (same mouse) to open there.