Some Android devices feature a gyro (gyroscope) sensor. Some only have a compass sensor.
Besides a gyro being 3D and a compass being 2D, what are the differences between a gyro sensor and a compass sensor?
A compass is showing north, nothing more.
A gyro sensor checks the horizontal position, where is up and down. With this sensor you can create these funny games like "Waterslide", where the phone checks, to which side you hold your phone. The gyro sensor cannot see where north is, like the compass.