Windows phone allows background processes to run in the background, and be aware of positional information. Prior to Windows Phone 8, these are limited to a cached location that the operating system updates every 15 minutes or so. These same background processes could react to this locational information and react in a similar way.
With Windows Phone 8, app developers can gain accurate, and up to the second positional information whilst running in the background, so this could also do the same, with a higher level of accuracy (as well as allowing more flexibility for things like tracking a mountain bike route, etc.)