What the 'purpose' is? it doesn't have a purpose. it has a cause, and a multitude of effects, but unless you believe everything has a purpose... solar storms don't.
As far as causes... It could be anything from varying magnetic fields to simple temperature differences creating currents in the plasma. It could also be a high pressure system of plasma being ejected from the surface of the sun, much like a geyser or volcano on earth.
Effects range from satellite damage, shut down radio communications, or even shut down power.