Whatever the cause is, there is always a fix for a particular issue.
It may well be an incorrect configuration in your Mac, a third-party email account conflict, or a software glitch. Now there are a couple of factors that can cause this issue, especially on the software level. It is indeed frustrating to have to minimize or close it from time to time, which interrupts your attention. Apparently, the Mail app will just pop up into the screen while you are working on your Mac. There have been similar cases like this, with several users having reported it over on the forums.
Find that the Mail app randomly opens while you are working on your Mac running macOS Mojave?