This is to address the reality that your iron engine block has a magnetic field, as well as electronic components that you run in the cockpit. Your compass can even be affected if steel screws were used to attach hardware rather than brass screws. Collectively, these fields can sometimes reinforce the north-pointing field that affects your compass. They can sometimes oppose it. A deviation card tells you what you need to do to steer a given magnetic course.
An airplane has the same sort of issue with engine mass and electronic components as a yacht does.
Transportation Canada regulations require every aircraft to have a deviation card.
Your GPS (with a time lag of maybe 30 seconds) will indicate which way your vessel is MOVING...but it does not tell you which way your bow is pointing. This can leave you missing one piece of information you need to work out what currents/leeway are doing to your vessel.
Particularly if you are sailing out of the sight of land, it can be difficult to determine the strength and direction of any current you may be sailing in. Being able to sort that out can save hours (or even days) in your journey.
Fundamental to navigation is knowing your compass heading...and fundamental to that is having a deviation card.
A few years ago, a friend of mine bought a Bavaria 46. Delightful boat. Two steering wheels, each with its own steering compass, and a digital compass as a third mounted in a center console.
The problem was that no two of these compasses agreed with each other...and the spread between them was 35°. This made anything other than navigating-by-eyeball impossible. While the vessel had a GPS chartplotter, the display was down in the cabin. There was no chartplotter up by the steering wheels. Attempting to use a cellphone GPS in bright sunshine was out.
Had we ever run into serious fog, we would have had a problem since we never knew quite which way we were going.
We could have tried to correct the three steering compasses by referencing them against a hand-bearing compass...but we were a little reluctant to use a magnetic compass to correct a magnetic compass, particularly in that we were not positive that we knew where to stand in the boat with the hand compass that would be completely free of extraneous magnetic interference.
So we found a spot in Barkley Sound where there were two navigational lights that defined a range we could use. Our plan was to motor back and forth across this range using a pelorus to get "snapshots" of our instantaneous heading relative to the range.
The problem was that we simply were not good enough. Sailing on a course at right angles to the bearing of the range gave us only a second or so to get our data, and we never really succeeded. None of us were good enough with the pelorus. The problem was exacerbated if the person on the wheel was not precisely on the specified course as the instant you passed across the line of the range. Sometimes the pelorus guy got a good reading, only to find out that instead of steering at 60° as was intended, the helmsman had us on a course of 72°. In spite of spending an hour cruising back and forth, we were unable to develop the data to let us create deviation cards for those compasses.
I came to the conclusion that what was needed was a technique that gave you 15 or 30 seconds on each course you might steer to collect data, comparing what your steering compass said your course was to what your actual course steered at that moment is.
If you decide that you are going to read your sun-compass bearing as the boat is on a heading of 150° M, and you are going to wait until the sundial time is 10:15 AM, you can start settling the yacht on 150° five minutes in advance.
When the local solar time hits 10:15, you line up the sundial shadow on 10:15, and align your pointer with the centerline of the boat. Given that the shadow on the sundial is only changing at the rate of one degree every two minutes, you can take a full 30 seconds to make sure you are happy with your data, and still only have a ¼° error.
Further, once you have your deviation card made (clouds permitting), the sun is an invariable guide to directions. As long as you know the time, the sun is a lighthouse in the sky that can be used any time and any place, taking only a few seconds to get a true bearing.
In regions where a magnetic compass is of little or no use (as in the Canadian arctic, where you are so close to the magnetic north pole that your compass simply doesn't work right), a sun compass may be the only way to tell directions.
During WW2, there was a group of British commandos that operated behind German lines in North Africa. They went charging about in small jeep convoys, blowing things up. Nobody had yet mapped compass variation in the Sahara Desert, and deviation in a steel jeep with an iron engine and steel weapons mounted behind you...all this made magnetic compasses useless.
So the second jeep in the group had a navigator and a sun compass. Like ships at sea during the Age of Sail, they signaled course changes to the rest of the convoy by flags. A sun compass works as long as you know the time...and they got their time each evening by listening to the BBC.
You can read about this in The Sundial Goes to War.
The Long Range Desert Group were using a different style of sun compass than us, having a vertical gnomon rather than a slanted one. There several possible sundial/sun compass designs, and each has its own particular advantages. A tall, vertical-gnomon-style sundial is better for use when you are near the equator. A slanted gnomon is better for use if you are far from the equator, as we are in Canada.
Here is an intriguing video, made in 2003, of a Boeing 737 commercial aircraft flying in the Canadian arctic, and using a high-tech (but still fully mechanical) sun compass to calibrate their navigational instruments: https://www.youtube.com/watch?v=P6J5nfflNNY
In their case, rather than having a different sum compass for each different degree of latitude, they have a related instrument (called an "astro compass") with dials that can be used at ANY latitude. While antiques, these are still available at $360 US from Celestaire.
Frankly, for the yachtsman, I think a $5 homemade sun compass will give better results than a $400 astro compass. And the style of sun compass described here requires no use of the Air Almanac or Nautical Almanac. The only calculations have to do with variation and deviation.