A gyroscope is a device with a spinning disc or wheel mechanism that harnesses the principle of conservation of angular momentum: the tendency for the spin of a system to remain constant unless subjected to external torque.
Gyroscopes are used in many inventions both old and new to stabilize, guide or measure rotational movement. Wheels on a bicycle, for example, act as gyroscopes as they spin up to speed, making it easier to stay upright and harder to upset momentum. Guided missiles use gyroscopes to track and guide their courses.
Altering the direction of a device with a gyroscope is achieved by rotating the gyroscope, changing its axis of output force. The measured rotation of multi-axis gyroscopes through sensors enables accurate measurement and guidance of many devices.
Much recent gyroscope-related discussion revolves around smartphones. In combination with gyroscopes and location tracking technology, smartphone accelerometers can be used to detect the movement of the device in 3D space. This accurate movement tracking is used for functions like orienting the display correctly for viewing. The sensors can be used for game, app and virtual reality control, not only in smartphones but also in other devices such as VR headsets.
Despite their usefulness in these areas, gyroscopes also present some security issues. The capabilities of gyroscopes can also be used for location tracking, whether desired by the user or by other parties who have -- or gain access to -- the device. Along with modified speech recognition software, the devices can enable eavesdropping when a microphone is not available. They might also be used to maintain the accuracy of keyboard vibration attacks despite movement of the phone.
See a video about how gyroscopes seem to defy gravity: