In a collaborative effort, Apple and Google have developed an industry-standard detection feature called “Detecting Unwanted Location Trackers” (DULT) for Bluetooth trackers. This standard allows users on iOS and Android devices to be alerted if an unknown Bluetooth tracker is monitoring their location.
For airtags that was, at least until recently, the case. You could only detect “lost airtags”.
Which makes sense, since only then they are relevant for stalking etc.