I have a Wifi iPad and this compass actually knows the direction of north. Now I know it's quite possible to use the gyroscope data to fairly accurately track device rotations once north has already been established, but how on earth does it know the actual direction?
Now I'm pretty sure the ipad does not have a magnetometer... or does it? It's got a bunch of magnets all along its sides!
My reasoning is that if it didn't come with the Compass app, the device doesn't have a magnetometer.
Update: Okay I'm able to affect the result by moving a magnet around a stationary iPad. So it does have the magnetometer after all.
iPad and iPhone (3GS and later) have a digital compass (magnetometer) chip onboard, such as the AK8975 3-axis Magnetic field sensor.
By the way, it can be calibrated, see here: http://support.apple.com/kb/TS2767
In addition iPad also has gyroscope and accelerometer chips.
If you want to peek inside the iPad, check out the ifixit site and the teardown at chipworx.