iCloud can cause your games to minimize randomly because of a notification. To fix this, you can exit the iCloud app entirely so that it doesn’t run in the background and annoy you with notifications. You can reopen it and check the notifications afterward when you’ve stopped playing the game.