It doesn't actually "predict" the earthquake, but rather relies on the fact that data now travels faster than the quake itself.
Android sees a bunch of phones near the epicenter record accelerometer data indicating an earthquake, and it alerts other phones that may be within the calculated area of effect.
Since data is faster than the traveling earthquake, people get an alert a few seconds before it hits.
Google Blog entry on how it works:
Earthquake detection and early alerts, now on your Android phone
