This has been built in since Sequoia. It’s literally dragging the window like aero snap.

https://support.apple.com/guide/mac-help/change-window-tilin...

This does require displays to have separate spaces though!