The Sun is a giant magnetic star, made up of materials that moves in unison with the laws of electromagnetism. Scientist are not sure where in the Sun the magnetic field is created. The solar magnetic system is known to drive the approximately 11 year cycle of Sun activity. The Sun's magnetic field smooths out slightly until it reaches its simplest state. At that point the Sun experiences what known as "solar minimum". when the solar explosion are least frequent. From that point, the Sun's magnetic grows more complicated over time until it peaks at the solar maximum, some 11 years after the previous maximum.
The Solar wind is not uniform, and it is always directed away from the Sun, changes speed and carries with it a "magnetic cloud. These high and low streams interact with each other, and alternately pass by the Earth's magnetic field and can storms in the Earth's magnetosphere