I've found that most attempts to explain this principle are, characteristically, peculiarly terrible.
In particular, you'll always see talk about how "turning" causes compass errors. Well turning doesn't cause compass errors, it's _banking_ that causes compass errors, it just so happens that in an airplane, when we turn, we bank.
Imagine the Jolly Green Giant holding the plane in the air, wings level, at a normal cruise pitch attitude, nose pointed to magnetic North. The bit of the compass that has an "S" on it is attracted to the North Pole, so it's attracted straight ahead (it's the "back" of the compass, facing away from us, right now). However, the magnetic North Pole is actually "below" the plane's nose, so that "S" on the compass is also being pulled downwards slightly. With the plane's wings level, the compass' motion is constrained along that axis, and so our "S" can't dip downwards in response to that downward pull (and if it did, it still wouldn't change the compass' heading indication). But when our giant tips the plane's left wing low, our "S" now has a place to go in response to the downward pull, it slides "downhill" a little bit. It's just a little bit, because as it slides downhill, it ends up shifting a little away from North, so the shift is small, as it balances the pull towards both North and down.
So what happens when we dip our left wing, the "S" moves a little "downhill" (i.e. to the left)? Well, if the back of the compass moves left, then the front of the compass has to move right. Previously, we were staring at a big N, but as the big N moves to the right, the heading we'll be looking at is, say, 005 or 010. So dipping our left wing low causes the compass to read as if we had turned to the right. Similarly, dipping our right wing low would cause the compass to read as if we had turned to the left.
It's not the turning that caused this error, it's the "banking".
-harry