How KeePair tells left from right
Newer AirPods have motion sensors in each earbud. KeePair uses them to work out which side is missing.
One sensor at a time
Your iPhone reads motion from one AirPod at a time. When that AirPod leaves your ear, the readings stop or move to the other side.
Which models
Left and right detection works on AirPods (3rd generation and later) and on AirPods Pro.