State Farm sends a Bluetooth beacon that you pair with your phone. Each car gets a beacon. Whichever beacon is closest is the car you’re in. The app on the phone uses gps and accelerometer data to determine driving behavior. Presumably the stream of data is sent to the insurance company at some point.