First off, the performance rate of GTK 3 on macOS is terrible for a number of reasons. It uses cairo-quartz which is already not-great in terms of speed. On top of that if you’re using client-side-decorations at all, you are incurring a very expensive blend operation by the compositor because the window region is treated as non-opaque (GTK 4 does fix this when using Cairo).
Furthermore, if you have a modern mac chances are you have HiDPI too. The amount of pixels to push to the screen on every frame is usually just too much.
When you put the window into the background, you start to obscure things, which allows the compositor to clip more aggressively on what it damages during composite. So chances are you are just seeing less drawing happen on each frame, both by the app and the compositor.
If you want to verify this, try using Quartz Debug tool and turn on things like Opaque region highlighting and flash updates.
If you take the time to read the GTK source code, you’ll notice that it does set foreground application status.