When you connect your AirPods to a MacBook, they automatically switch the system’s default input to their internal microphone. Not only is the mic quality poor, but this behaviour also reduces the overall audio quality of the AirPods.
You can reorder your input / output devices based on your preferences directly from yhe toolbar, and the topmost available device will be always forced as system default.
brew install soundanchor