It doesn't work by following navigation - GPS is nothing like accurate enough.
It compiles Street View, GPS, previous tracks, a video archive, radar and live video feeds to do several things.
1. It knows roughly where you are thanks to GPS
2. It compares where you look like you are from the video to make the GPS more accurate
3. It compares previously driven tracks with yours
4. It has a 3D 'memory' of the area, so can identify things that aren't usually there: be they cars in front or pedestrians waiting to cross
5. It senses distance to other objects and adjusts speed accordingly.
6. Ideally it would be talking to nearby vehicles and they'd all coordinate responses, but that's not going to happen for a long while.