I'm guessing this works exactly the same way as Apple's "Findable After Power Off" feature [1]. If the phone "dies" the battery still has some reserve to display the "charging needed" screen when the power button is pushed, along with sending ___location. Additionally, it can use the Find My network [2] where other devices that are powered on can relay the proximity device's ___location using their own ___location.
1. https://www.theverge.com/22697218/iphone-apple-ios-15-find-m... 2. https://developer.apple.com/find-my/