How does an iphone directional compass work?

That’s true to a large extent. The biggest source of error is the ionosphere, and the fact that “weather” up there can change the path length of a radio wave. Some of this can be corrected for, but not all. On the other hand, it varies fairly slowly, so you can use a nearby fixed reference point as a correction. The ionospheric error also averages out over a very long period (days, months), so you can also get a good result by sampling over an extended time. Geologists use this to track continental plate movement to millimeter precision.

Yeah, that’s the “differential assistance” that @bump referred to. I think nowadays they do it at cell phone towers, too.

But you’re right that that systematic error would cancel out on a GPS compass, so you could make one much smaller than the size of the error circle (though still probably not as small as a phone).

Thanks. I did check a couple of pages online, found some info on the WAAS system used by the FAA, but they didn’t answer that specific question.

Atmospheric humidity also plays a role:

In fact, weather/climate scientists use GPS signal error as a way to measure atmospheric humidity:

No mention of Hall effect devices? You can get extra sensitivity by using more than one, e.g. mount two of them in opposite directions and amplify the difference. GPS is not a magnetic compass, obviously. It does usefully tell you where you are at.

It seems the solid state compasses used in phones are usually Hall effect sensors. Which was a surprise to me. I didn’t think the needed sensitivity or signal to noise would have been viable. But it seems it is. I had always assumed they used a flux-gate magnetometer.

You get some silly capable technology now. In a previous life I used to worry about geological surveys done in magnetics and gravity. Modern surveys are done with tensor output, and use a Squid - superconducting quantum detector for ridiculous resolution. (What is even more brain melting are the flown gravimetric surveys. I still can’'t believe that they can work, but they do.)