Cool stars, like the Sun, have convective envelopes that support a magnetic dynamo, heating a corona to X-ray emitting temperatures via magnetic reconnection (and other magnetic processes, perhaps)