https://support.apple.com/guide/iphone/switch-airpods-betwee...
> To prevent AirPods from automatically switching between devices, go to Settings > Bluetooth. Tap the Actions Available button next to the name of your AirPods, tap Connect to This iPhone, then tap When Last Connected to This iPhone.