Can someone explain the Fitness+ function on iPod nano?

Options
I sent in my old nano to Apple when they had the recall, and they sent me a (what are we on, now? 6th Gen?) 8G touchscreen ipod with a clip on it - perfect for running. Along with the Music, Podcast and Radio functions, there's a fitness app that apparently counts calories, distance, steps, etc.

How does it do it? I plugged in my height and age and weight, so that could be where the cals are coming from, and it probably counts steps by hip movement just like a regular pedometer, but I don't understand how it gets the distance or the speed. (It will say Current Pace: 17min. Mile or whatever)

Does it calculate by how long it thinks my legs are and how quickly I'm stepping, or does it somehow do a GPS-type thing with its radio capability, or what?

The calories logged are pretty close to MFP's estimates, but I don't have an HRM to check either for personal accuracy.