Since macOS 10.12 there’s a bug in Apple Mail that causes it to randomly become the frontmost application. If you are in full screen mode — like when you are giving a talk or watching a movie — it opens itself up in split view mode where it takes up half the screen while your other main window is being resized.
I saw this happening first hand when coworkers showed me something on their computers but never experienced it myself. This has been happening since at least macOS 10.12.
After some research it became clear that it’s related to Gmail and I’m not exactly the only one:
The proposed solutions are to disable Power Nap (I don’t see how that could be related) or to remove Gmail. I wouldn’t call any of these a viable solution.
Unfortunately now I’m also in the select group of people experiencing this bug.
I tried to confirm the theory of Gmail causing it and could partially reproduce it. The bug only seems to happen with Gmail accounts that are part of a G Suite account and not with my personal Gmail account. It happens 1-2 times per day.
Funnily enough the bug only started to show up when I got my new Mac Mini with a clean install of Catalina. This makes it pretty clear that this is not some third party app causing havoc but just yet another critical bug that hasn’t been resolved in an increasingly longer list of macOS releases. It’s not as critical as Mail.app deleting emails but it’s still not something you want to have happening every few hours.