The compass is set on a pivot with the magnets suspended below the pivot point, so that the centre of gravity is below the pivot. This is to allieviate the problem of the magnets dipping towards the nearest pole, giving the compass "Horizontality".
The compass errors in turning through north and south and accelerating on east and west are due to the inertia in the suspended magnets causing them to be "left behind" leading to a reaction and a turning moment. Errors are also due to the z field effect (the effect of the earth's vertical field component) and to a slight extent liquid swirl (a bit like the workings of the inner ear)
Like most things, this is best explained with pictures on a whiteboard, or using whiteboard markers representing the magnets in conjunction with a model aircraft.
------------------