Right, here we go then, first a word from NASA:

We do not completely understand this process either in the sun or in the earth, BUT one of the prevailing theories called the Parker Dynamo Theory predicts that in a rotating, conductive system where magnetic fields are subject to 'cyclonic convestion', you end up with field flips with a time interval that depends on the density, conductivity and rotation rate of the system. I am not an expert in this area, but at least there is a theory to start from that SEEMS to explain some of this, and it works for both the sun and the earth! But there are many unsettled issues about just how the magnetic field is generated in the first place, and several observations that do not support this theory very well.
(my underscoring)

Then a link because this one is a bit too long to quote here.

It is interesting to note that none of these theories seem to wish to take into account the basic theory of electromagnetism, which given the present direction of the solar wind and the rotation of the earth would by it's very nature create a magnetic field similar to that found surrounding our planet, although not of the same magnitude. However, it could provide a type of 'excitor' field.
The properties of excitor fields are well known in commercial power production where they used to create much greater magnetic fields at the heart of modern generators. Interestingly, in power generation it is the necessity to keep excitor fields in phase with the power being generated. Of course this is easy to do, since the field generator is simply a feedback from the power generated in the first place.
But there is no direct feedback in the case of the earth, so it is possible for phase slip to occur. And the side effect of phase slip is...

...field reversal.