A Coronal Mass Ejection, or CME, is when the sun suddenly releases a lot of matter and energy from its surface, flinging it outwards into space. To understand why it would do this, we need to know a bit more about how the surface of the sun works.
The Sun is a miasma of incandescent plasma, and it rotates around its axis once every 30 days (roughly). But because the sun isn’t a solid body like the Earth, the entire Sun does not have to rotate at the same rate. If the equator of the Earth tried to rotate faster than the poles, the rocks that make up the surface of our planet would have to shear apart. But because the Sun is just gas, it can have an equator that rotates a few days faster than its poles - a gas doesn’t have the same resistance to shear as rock does.
The Sun also has a pretty intense magnetic field, which normally would start at the top pole, and travel smoothly downward to the bottom pole, as it does on the Earth. However, since the equator of the Sun is travelling a little bit faster than the poles, the magnetic field gets dragged along with the faster material, which pulls the magnetic field into a twist. After enough twisting, the magnetic field begins to form little loops that pop out of the surface. You can replicate this effect by taking a bit of string or cable and twisting it - at some point, the cable will want to make a twisted loop if you give the line some slack. These little loops tend to be associated with sunspots.
As the years go by, the magnetic field of the sun gets increasingly twisted, and these loops get bigger and more common on the surface of the sun. As the magnetic fields get increasingly tangled up in themselves, if the bases of the magnetic fields (or, in our cable analogy, some of the cable closer to your hands, not in the loop itself) touch, they snap together and create a new magnetic line, without the loop. This then leaves the loop in the lurch - but it doesn’t just hover over the surface of the sun. The ‘snapping’ together generates a lot of energy, which is all dumped into flinging the material which was trapped in the loop outwards, into the solar system.
These particles have extremely high energies, which means they leave the sun’s surface at an extremely high temperature and at an extremely fast pace. Since these can occur at any point on the Sun’s surface, (although they don’t tend to form at the exact poles, since the magnetic field doesn’t get very twisted there) and and the Sun is constantly rotating, the probability of a CME being headed straight for the Earth would be pretty low, if they shot directly out from the surface. However, CMEs are notable because they eject particles over a wide swath of space, so our odds of running into this stuff is much higher than you would expect. So what happens when they head for us?
Fortunately, the Earth’s magnetosphere takes the brunt of the blow from these particles. The magnetosphere can be thought of as a giant magnetic shield, deflecting charged particles that come our way. This protects us from most of this kind of radiation from the sun. Our magnetic field sinks into the planet at the magnetic north and south poles (close to, but not exactly the same as, the rotational north pole). This means that there’s a bit of a divot in our magnetic field, and particles can get stuck in here, and go around bombarding the atmosphere with radiation, causing the atmosphere to glow. This is what causes the Northern and Southern lights - also known as the aurora. If you’re in the far north and you hear that there’s a solar storm coming, head outside when it hits - there’s a good chance of seeing the aurora any time a CME comes our way.
Less aesthetically pleasing is the fact that CMEs can do a fair amount of damage to some of our satellites in orbit. Satellites are built to be able to handle slightly more than an average amount of radiation under normal circumstances. But if we’re getting hit with the kinds of energies that CMEs bring, even after 93 million miles, some satellites can’t handle the dosage. The constant bombardment of the satellite by charged particles can cause the satellite itself to become charged. This is very similar to becoming electrically charged by shuffling around in socks on carpet. If the satellite gains enough charge, it can short-circuit itself, which will kill the satellite, if a crucial part fails. (In space based satellites, most parts are crucial.) This kind of thing mostly affects satellites that are in very high, particularly geocentric orbits, like GPS satellites. The International Space Station is usually unaffected since it’s in a lower orbit, although in the case of strong storms, the astronauts can take shelter in more highly shielded portions of the the ISS.
On the surface of the Earth, most of the time the most noticeable part of a CME is the aurora; most of the other consequences of a coronal mass ejection just don’t make it to the surface.
That said, in 1989, a solar storm knocked out power to 6 million people living in Quebec because there was so much turbulence in the magnetic field of the Earth that it induced a current in the power lines, and overloaded a set of circuit breakers. In the face of extremely large coronal mass ejections, we can have problems on Earth. Fortunately, as long as we have telescopes observing the sun, we will always have several days warning.
Have your own question? Curious about something I wrote here? Feel free to ask!