Part 1: Coronal mass ejections (CMEs) happen when the sun releases a huge burst of solar wind and magnetic fields. This usually occurs when there are disturbances or explosions on the sun's surface.
Part 2: One way CMEs affect Earth is by causing beautiful auroras, like the Northern Lights, to appear in the sky. Another impact is that CMEs can disrupt satellites and power grids on Earth, causing problems with communication and electricity.