Right - the phone itself is what is keeping track of the air tag, but if the phone doesn't detect the airtag for some period of time, I assume the anti-stalking timer resets. This is why if you walk past an airtag on the way to the store, and then walk by it again 20 minutes later, you won't get an anti-stalking alert.