Windows and Linux automatically filter out sounds outputted from the desktop when recording mic audio but macOS doesn’t, and there isn’t an obvious answer to this.