If you’re using an Apple display with your MacBook or desktop Mac, things are generally flawless. However, non-Apple displays can exhibit weird behavior such as flickering, and it’s not always obvious how to fix it. There are some things you can try, though.
There’s a feature known as Adaptive Sync in macOS that becomes available when you use the right combination of hardware. Specifically, if you have a variable refresh rate monitor and use a DisplayPort connection. What this does is change the refresh rate of the monitor dynamically to match the frame rate of the content on screen.
There are two reasons you’d want to use Adaptive Sync. One is to conserve electricity, which isn’t particularly useful for a desktop monitor connected to the wall. The second is to prevent issues such as pulldown judder when playing (for example) 24fps movies. If you’re editing video content, adaptive sync is a great tool to have, since you’re seeing the content at the frame rate it’s meant to have.