Coronal mass ejections are often associated with other forms of solar activity, most notably solar flares, but a causal relationship has not been established. -- wikipedia
But both tend to occur in areas of sunspots and underlying magnetic field disturbances (closed loops). The CME can expel much more matter as can be inferred from the name, whereas a flare is essentially a sudden brightening accompanied by plasma ejected into space and sometimes a solar prominence. It was once thought that a CME was driven by an underlying flare but this does not always seem to be the case. Originating in the corona, it is now known that a CME can occur without an associated flare.
Thank you for the info, I am a total novice at astro-physics. I appreciate you taking the time to enlighten me.