They technology of small electro-mechanical sensors of all types has been improving incredibly rapidly in recent years.
The electronic compass we put into the Cobalt 1 years back was slow to respond, and probably only accurate to within 5° or so. The current Cobalt 2 compass is fully integrated with the accelerometer in one chip and we reliably get 1° accuracy- note that this is fully 360° tilt compensated, which an analog compass would not be. This is consistent with what the chip manufacturer specifies they see in military applications, where they are used extensively. It is a magnetic sensor. I believe the latest version of these sensors are (depending on the interface and implementation, of course) superior to traditional compasses, if only because they aren’t affected by tilt. But they also respond more rapidly to course changes, can display digital headings, and provide multiple (90°, 120°, 180°) heading offsets.
The iPhone is not a fair comparison, as the implementation is more for general orientation and entertainment, not really navigation. And it isn’t (not mine, anyway) fully tilt compensated.
I do question the article’s methods for testing- the photo shows two iPhones on either side of a magnetic compass- of course the iPhone’s compass would be deflected by the magnet in close proximity. But there is a lot of engineering and firmware behind making an accurate electronic compass, sensors do differ, and it’s very likely that this is not a priority for Apple.
-Ron