That’s third parties, not Apple, tracking people in a way that was blocked by Apple years ago. Apple devices rotate their Bluetooth MAC address regularly so they cannot be identified from the beacons.
Not claiming they do it, but it seems quite possible to triangulate a coarse location via Bluetooth using other phones with their location services enabled. I tinkered with something similar in college, just using little BLE beacons intended for this kind of thing instead of phones.