The outer third of our sun transfers energy to the surface by convection. Below this layer, energy moves outwards through radiation. The place where these two zones collide is called the tachocline, and is located approximately 130,000 miles below the surface of the sun.

Now, different regions of the sun rotate at different speeds. For example, while the equator of sun rotates once about its axis in just about 27 days, the poles take around 35 days. But this variation doesn't just occur on the surface. Regions on the interior of the sun also rotate at different speeds.

The rotation rate of the zones just above and below the tachocline changes rhythmically with a period of around 16 months. When the convection zone speeds up, the radiative zone slows down, and vice versa. It is believed that this constant change and conflict of motion creates large magnetic fields, which build up and force surrounding gas to erupt to the surface as a sunspot.