It really isn’t magic, which is exactly why Linux is so amazing. You can use any tiling window manager and it will act the same way. It will detect the screen of the device and give you ways of altering it to your liking with a few lines of text. And it’s all documented how to do it.