Here are a few excerpts from a June 1, 2021 Wall Street Journal article by Nicole Nguyen. Maybe it's redundant, maybe it's helpful (though it doesn't seem to address the problem with cars and Bluetooth):
...Apple’s latest software, including updates released last week, acknowledges that there are issues in need of fixing. The updates—iOS 14.6 for iPhones and Big Sur 11.4 for Macs—provide solutions for AirPods disconnecting, sending audio to a different device during a call, sending audio to the wrong device, and showing too many prompts to connect. An Apple spokesman said users should install the updates for all devices for the best experience and interoperability, and the software should provide a remedy to the bugs outlined above.
Apple is investigating additional problems I sent over on behalf of readers, which include a set of AirPods Pro with only one bud that connects, another that takes about a minute to pair with the iPhone, and AirPods that appear in the audio source menu but aren’t automatically selected.
Still, the current fixes don’t address the bigger issue: Automatic device switching, which came to Apple devices last fall, isn't working as intended—and it’s annoying....
...A better solution would be a quick way to disable switching temporarily, something like the iPhone’s screen-rotation lock. Currently, you can only choose between automatic switching and the confusing, word-jumbled “Connect to iPhone/iPad/Mac... When Last Connected to This iPhone/iPad/Mac” option. (Don’t worry, I’ll explain that in a second.)
I’ve reviewed a lot of wireless earbuds, and Bluetooth connectivity is a challenge for all of them. So it isn’t a complete surprise that AirPods don’t work perfectly all the time. But when you pay a premium and become accustomed to a certain level of “magical” Apple seamlessness, there’s more room for disappointment....
Make sure your device has the latest updates.
If you’d rather your AirPods not decide by themselves when to switch, turn off automatic device switching on all your Apple devices. On the iPhone and iPad, with your AirPods connected, open Settings, go to Bluetooth, then tap the “i” next to your AirPods. Select the setting Connect to This iPhone/iPad and tap When Last Connected to This iPhone/iPad. Repeat on the Mac: Open System Preferences, go to Bluetooth, and click Options next to your AirPods. Under Connect to This Mac, select When Last Connected to This Mac.
This means your AirPods will only automatically connect if they were previously paired with that device. If you switch from iPhone to iPad, then the next time you open your AirPods, they’ll connect to your iPad (if it’s nearby).
If AirPods wonkiness persists, reset your AirPods. (Just note that this will reset your connection and touch-control settings, too.) Put the earbuds back in the case and close the lid, then open the lid. On your iPhone or iPad, open Settings, go to Bluetooth, and tap “i” next to your AirPods. Select Forget This Device. Do the same on your Mac: Open System Preferences, then Bluetooth. Hover the mouse over your AirPods and select the “X” next to it.
Next, press and hold the small button on the back of the case, until you see the front-facing status light flashing orange. This can take up to 15 seconds. Place the AirPods close to your iOS device, and a connection pop-up will appear. Follow the steps on the screen.