
Duh
Your phone checks for nearby wifi then sends the MAC address of the wifi it finds to Google, who knows where these MACs are (because it found them all while driving past). Google then discards this information and uses it's crystal ball to find out where you are.