Most compasses in my collection use a magnetic needle to measure the direction of an object relative to magnetic North. As such they are disturbed by local magnetic deviations due to steel objects in the vicinity as well as the changing location of magnetic North relative to true North (variation). Some of the compasses can be adjusted for local variation.
A few compasses are of the gyroscopic or solar type and do not rely on the earth magnetic field. The gyrocompasses use a fast spinning mass (gyroscope) to indicate true North. The solar compass uses the movement of the sun and the fact that at 12:00 local (solar) time it points to South for obtaining directions.
The box compass can only point north / south. They are used for orienting an instrument in the North / South line rather than indicating a heading. Often used with the theodolite when it is not a 'full' boussole theodolite for setting up a reference direction. Also used with the plane table and alhidade for setting up the chart to point to (magnetic) North. These devices do not have a setting for variation.
The magnetic compass is used to navigate using either just the compass rose or a set of sights. As magnetic North is varying, the more professional compasses have an option to adjust for this variation by offsetting magnetic north from true north. The simpler compasses (mainly used in navigation) do not have this option but rely on the user correcting the instrument themselves.
Apart from the variation steel or iron objects will also attract the compass needle. The instruments have no adjustment for this as this value depends on the location ánd the direction the instrument is pointing in as the steel object itself becomes magnetic and acts as a 'north pole'.
The gyro compass points to True North rather than magnetic north and is used in surveying and navigation. There operation is based on a fast spinning mass (the gyroscope) which will stay in one place. By using a north seeking device the instrument is made to point to true north. This can be a lengthy process which is normally aided by pointing the compass in the right direction ('slewing' the compass).
The compasses in my collection are from Wild Heerbrugg and were designed for use on a theodolite. They are relatively small and cannot hold there true North pointing for very long. They were designed to be used when setting up an instrument and obtaining a reference direction. They are used in combination with a magnetic (box) compass for roughly pointing the instrument; then with the gyrocompass the exact alignment can be made.
The solar compass uses the movement of the sun to indicate North (or rather South in the Northern Hemisphere). It is an astronomic device which does not rely on anything but the knowledge of the movement of the sun. Essentially the principle is that at noon (local solar time) the sun is due South. However, for this the exact moment the sun is highest in the sky must be determined. For moments in between South can still be determined but this requires some knowledge of time (longitude) and location (latitude). Most solar compasses use a set of scales to solve for this problem.