I would say the sphere has a counterweight system and separate magnet system to link with the head (because the robot is able to move its head to the side without moving when it needs to). I'd imagine there's magnets in the sphere and head, and the head has powerered wheels/rollers as well. Its a very sophisticated trick.
It is Sphero, a startup making toys with flywheels. For example a spherical ball-thingy (sphero) you can move/control with your smartphone.