If you open an AirPods case while it’s near an unlocked iPhone, iPad, or Mac, an alert pops up asking if you want to pair to it. (Or, if necessary, letting you know that you grabbed the wrong AirPods case, and it’s paired to someone else’s equipment).
Then, the action of pairing causes Apple to associate the AirPods themselves with your Apple ID. If you have more than one device signed into the same iCloud account, all of them will effectively be paired to those AirPods, and you do not need to actively do anything in order to connect to them, and standard system volume controls gain the option to switch output devices (with the AirPods listed).
What non-AirPods headset pairs and switches devices that seamlessly and easily?