Gyros provide inertial reference inputs to AACS computers. If they have any moving parts, they are small and lightweight. Reaction wheels are fairly massive attitude control devices at the output of AACS computers. Mechanical gyros , used on Voyager and Magellan, rely on the rigidity in space of the axis of a spinning mass to provide attitude reference signals. This principle is easily demonstrated in a toy gyroscope.
Mechanical gyros have limited lifespans due to mechanical wear.
Laser ring gyros and fiber-optic laser gyros use interferometry to sense the Doppler effect induced in beams of light when the unit is rotated. Laser gyros have no moving parts to wear out. Hemispherical resonator gyros , used on NEAR and Cassini, sense movement of a standing wave in a fused-silica shell. The wave is like a wineglass 'singing' as you slide your finger around the rim. Null points in the wave precess when the unit is rotated.