By monitoring proxies for battery usage: CPU time, amount of time location services is on, etc. and building a model. It's not an easy problem, but for an app that is widely used such as Uber, it's not infeasible to attempt.
Uber does claim that they use it to switch to a low-power mode