No magnetism.

Today's gyros use piezo-electric crystals. When they bend, their electrical properties change, so they can be used to detect a change in the rate of rotation. Non-head holding gyros, or rate gyros, stop here, just providing control input while the rate of rotation is changing. This helps to dampen yaw changes thrown at the heli by the environment.
Head holding gyros go further. They have logic built in to use the rate of rotation information to calculate a heading. This allows a HH gyro to continue to provide control input until the original heading is re-acquired.
Basically, if a heli were hovering, and you reached out and pushed the tail to the side (don't do this, you will cut your finger):
If no gyro were in use, the tail would deflect a large amount.
If a rate gyro were in use, the gyro would tell the tail to take some corrective action, and the result would be that the tail would deflect a smaller amount.
If a HH gyro were in use, the gyro would tell the tail to take corrective action until it was back in the same position it was before you pushed the tail.