A feature belonging to the HTML5 Battery Status API allows a website to know how much battery life is remaining on a device being used to visit it. The feature reveals battery life remaining for devices using the Chrome, Firefox or the Opera browsers. Among the data revealed by the API includes how many seconds remain until the battery has completely discharged, and the percentage of battery life remaining.
Once you've computed all of that information about battery life, the data can help determine the capacity of the cell being used on a specific device visiting a website or web-app. Once all of this information is discovered, certain patterns will emerge. The patterns can be used to track devices across different sites. Once you know how fast a certain phone is losing its charge, or gaining power, you can track how often a specific device has visited a certain website with a fairly high degree of accuracy.
"In this section, we discuss several potential fingerprinting and tracking scenarios. A third-party script that is present across multiple websites can link users' visits in a short time interval by exploiting the battery information provided to Web scripts. In order to do that, scripts can use the values of battery level, dischargingTime and chargingTime. The readings will be consistent on each of the sites, because of the fact that the update intervals (and their times) are identical. This could enable the third-party script to link these concurrent visits. Moreover, in case the user leaves these sites but then, shortly afterwards, visits another site with the same third-party script, the readings would likely be utilized to help in linking the current visit with the preceding ones."-excerpt from The leaking battery, A privacy analysis of the HTML5 Battery Status API
Because information is updated every thirty seconds, there is a limited time that a device can be tracked. Still, half a minute appears to be enough time to obtain the necessary information allowing you to compare the battery-centric metrics of different devices, looking for a match. And once a match is achieved, other pieces of the puzzle start falling into place.