There are two bluetooth profiles in use here: "A2DP" (Advanced Audio Distribution Profile) and "HFP" (Hands Free Profile).
A2DP is how you send high quality audio over standard Bluetooth. The basic codec is OK, and you can negotiate much better ones. It's only one direction though, no microphone
HFP is the classic profile that's been around since the dawn of Bluetooth that allows you to make calls. You get microphone in one direction and (mono) speaker in the other, but it works in a fundamentally different way to A2DP and so the bandwidth and codec selection are much more limited.
Bluetooth devices can only do one of these at a time, so if you're just playing audio you get A2DP. But if there's a need for the microphone it has to switch to the other profile, and you get the low quality audio. At least these days software (usually) does do this switch seamlessly, it used to be worse...