The sun experiences various kinds of eruptions of energy, both large and small. These explosions include both solar flares and coronal mass ejections (CMEs). Solar flares are powerful bursts of light and radiation. CMEs on the other hand, are sometimes followed by solar flares, and are massive bubble-shaped eruptions that are capable of travelling 2,000 Kms a second and reaching Earth between one and three days.

CMEs are so powerful that if the Earth is hit by one such eruption, they could potentially wipe out every man-made technological device, plunging mankind into long-term power cuts and more.

A new study reveals that at the very heart of solar eruptions lies a dramatic, magnetic power struggle. Scientists discovered that the magnetic fields at the solar surface act as a giant cage to prevent evolving CMEs from erupting.

The new research involved a team of scientists, led by Tahar Amari, an astrophysicist at the Center for Theoretical Physics at the École Polytechnique in Palaiseau Cedex. They used data from Nasa's Solar Dynamics Observatory (SDO) to examine a Jupiter-sized sunspot area – a site known for solar activity. Despite conditions being ripe for a massive explosion, this region failed to produce a major CME, instead emitting an intense X-class solar flare – the most powerful class of flares.

The researchers incorporated SDO's data in models that calculated the magnetic field of the Sun upper atmosphere, called the corona. The model revealed a fierce battle between two significant solar magnetic structures – a twisted magnetic rope, which is associated with the onset of CMEs, and a dense cage of magnetic fields covering the rope.

"The scientists found that this magnetic cage physically prevented a CME from erupting that day. Just hours before the flare, the sunspot's natural rotation contorted the magnetic rope and it grew increasingly twisted and unstable, like a tightly coiled rubber band," Nasa said in a statement. "But the rope never erupted from the surface: Their model demonstrates it didn't have enough energy to break through the cage. It was, however, volatile enough that it lashed through part of the cage, triggering the strong solar flare."

When the researchers tweaked their model, they discovered that, had the magnetic cage been weaker that day – on 24 October 2014 – a massive CME would have erupted.

"We were able to follow the evolution of an active region, predict how likely it was to erupt, and calculate the maximum amount of energy the eruption can release," Amari said in a statement. "This is a practical method that could become important in space weather forecasting as computational capabilities increase."

The findings of the new study have been published in Nature.