That’s how the Find My network works. Your apple devices are constantly looking for other apple devices around you and report their location to the Apple servers. It’s anonymized, so apple can’t link your device to the location, but can send the specific location of the device to their owner.l believe that this is what you agree to in the recent Apple agreements that most people never read--because they are very long. So if you have an IPhone, you're tracking all kinds of airtags and devices that are not yours.
It’s actually a fantastic piece of technology.