The primary means of determining heading in most small aircraft is the directional gyro, as this instrument is unaffected by the magnetic dip errors that cause a magnetic compass to give the wrong heading when at a nonzero angle of bank. However, due to the rotation of the earth under the aircraft, the aircraft's movement over the curved surface of the earth, and friction within the gyro assembly, the directional gyro has to be periodically realigned, using the magnetic compass as a reference.
All well and good, but there are large parts of the earth where a magnetic compass cannot be trusted, because the horizontal component of the earth's magnetic field is too weak or erratically variable. Examples of such areas of magnetic unreliability include the areas around the earth's magnetic poles (for instance, northern Canada), where the magnetic-field lines go almost straight up-and-down rather than side-to-side, and areas with large localized changes in magnetic deviation (for instance, western Lake Superior, where all the iron in the ground causes magnetic compasses to read almost 90° off in places). Additionally, these areas go by true heading rather than magnetic (and the two differ considerably at high latitudes), so you can't even extrapolate a magnetic heading that you obtained before the compass became unreliable - you need to realign the gyro to true north as soon as you enter the area of magnetic unreliability.
Big airliners have GPS and IRS to give them an accurate measure of true heading and keep the directional gyro honest, but, if you're flying a small general-aviation plane not equipped with either, how do you correct the directional gyro's drift if you're somewhere your magnetic compass isn't reliable (especially if you're IFR and can't use ground landmarks to find where north is)? If you're departing from within an area of magnetic unreliability, how do you align the directional gyro in the first place; if you're just entering a magnetically-unreliable area, how do you realign the gyro from magnetic to true?