The Sun is made of gas, which is charged by it's electric energy. This created a magnetic field, which spreads throughout our entire solar system, carried by a solar wind. After 11 years, the magnetic field of the Sun effectively flips, so the North pole becomes the South, and vice versa. Then it another 11 years, they flip back, and so on.