Geofencing, or location-based triggering, uses your phone to detect when you’ve crossed a set boundary, and sends a corresponding signal to the iCloud servers.
Based on your geofence configuration, a scene command is then sent to your HomeKit accessories via your connected AppleTV (4th generation or later), iPad (Running iOS 11 or newer) or HomePod.