Why two qibla compasses point in different directions
Open two apps side by side and they will often differ by several degrees. None of them is lying; they are answering slightly different questions.
Magnetic north is not the north you want
A compass needle points at the magnetic pole, which is not the geographic one and does not stay still. The difference between the two — declination — depends on where you are standing, and it is not small: near zero across parts of western Europe, more than fifteen degrees in the Pacific Northwest, and larger still at high latitudes.
The qibla is a geographic bearing. So an app has to take the magnetic reading, look up the declination for your coordinates, and correct for it. An app that skips that step is wrong by exactly the declination where you live, every time, consistently — which is why it can look confidently wrong rather than obviously broken.
This is also why two apps can differ by a fixed amount no matter where you point the phone. One is correcting and one is not.
The sensor in your phone is easily confused
The magnetometer measures a field roughly fifty microtesla strong. A speaker magnet, a metal desk, a car door, the steel in reinforced concrete, and the magnets in a MagSafe case all produce fields that swamp it. You do not need to be near anything dramatic; a laptop on the same table is enough.
The fix is unglamorous. Move away from metal, hold the phone flat, and trace a figure of eight in the air a few times — that is not superstition, it is how the phone recalibrates its offset. Then take the reading again and see whether it settles somewhere different.
If the needle drifts while the phone is still, the reading is not trustworthy and no amount of software will make it so.
The direction that looks wrong on a map is usually right
From North America the qibla points north-east, not south-east. People check it against a flat map, see Makkah sitting to their lower right, and conclude the app is broken.
It is not. The shortest path between two points on a sphere is a great circle, and on the flat projections we are used to a great circle bends. From Chicago the shortest line to Makkah runs up over Greenland. The bearing you should face is the one at the start of that path, which is roughly north-east.
A flat map is a distortion of a globe, and the qibla is a question about the globe.
How close is close enough
Two apps a few degrees apart are, in practice, pointing at the same wall. Over the distance involved, a degree or two of error moves the target by a long way in kilometres but does not change which direction you turn in a room.
The widely held position among scholars is that facing the general direction of the Kaaba is sufficient when exact precision is not available — which is the normal case for anyone not standing in a mosque with a marked mihrab. Someone praying from a moving train is not expected to survey.
So use the compass to settle the direction once, in a spot away from metal, and then use the room: a wall, a window, the line of a rug. That is steadier than a needle that reacts to a passing radiator.