From: AirTag - Apple
"AirTag is designed to discourage unwanted tracking. If someone else’s AirTag finds its way into your stuff, your iPhone will notice it’s traveling with you and send you an alert. After a while, if you still haven’t found it, the AirTag will start playing a sound to let you know it’s there.
Of course, if you happen to be with a friend who has an AirTag, or on a train with a whole bunch of people with AirTag, don’t worry. These alerts are triggered only when an AirTag is separated from its owner."