The Solar Wind
I. Why stars should not have winds
If you write the equation of force balance for a plane-parallel strip of solar atmosphere, it says the difference in gas pressure above and below the thin slab in question must balance the weight of the gas in the slab. That looks like dP/dr = -rho*g, where rho is the mass density and g is the acceleration of gravity at the surface of the Sun. Since we are imagining a thin layer, we treat g as constant, and seek how P(r) and rho(r) depend on distance r above the surface. Since that is two variables, we need a second equation, so we use the ideal gas law, P = rho*k*T/m, where m is the average mass per particle, and now we need T also. But T will be varying much slower than P and rho, so we approximate it as constant and just take a value like 6000 K, typical of the solar surface region. Then we eliminate P in favor of rho, and get a simple differential equation that looks like drho/dr = -1/H, where H=kT/mg characterizes the height a particle at T can fly above the surface before falling back down (that's the "scale height"). The solution is an exponential, and the density rho falls by the factor e every time we look a distance H higher in the atmosphere (just like for the Earth).

Now we must check our plane-parallel assumption, which means we must test that H/R is small (so the radius R does not produce important curvature into the problem), and indeed it is of order 10^-4, even a bit smaller than it is for the Earth's atmosphere. But this has other consequences-- the solar atmosphere is tightly held, so the density drops very vast with height, and nothing can escape. Hence there should not be any solar wind if the T remained at about 6000 K.

II. The chromosphere
But it does not remain that cool, because the density drops so fast with height that its cooling (which is by creation of radiation when free electrons collide with and excite atoms that then radiate) becomes very inefficient (due to the rarity of collisions). Hence it becomes easy to heat this gas up to higher T (in the vinicity of 20,000 K, called the chromosphere) if any kind of additional heating is applied, and indeed such heating is applied. It comes from the ability of the convection zone to act like a heat engine, where entropy is generated when heat is removed from a hot reservoir deep in the Sun (which reduces entropy) and then that same heat is returned to the much cooler surface regions (which increases entropy much more, because the cooler gas "cares more" about getting that heat then the hot gas cared about losing it). Whenever entropy is generated by heat transfer, there is the possibility of siphoning off some of that energy, because there is excess entropy being generated and the process will happen spontaneously (i.e., without extra forcing). That siphoned-off energy can be in the form of mechanical work, which has no entropy consequences (it is "free energy", a technical term) and can be moved around and deposited anywhere.

This is how a heat engine works, so the convection zone works like a heat engine that can do work. The work comes in the form of creating sound waves (many heat engines are rather loud, are they not?), and also in twisting up and storing energy in the copious magnetic fields present in the solar atmosphere. This is "free energy" is transported all around, but the fraction of it that is deposited in the low density upper atmosphere has the greatest impact on the temperature, and is responsible for the "temperature inversion" above the solar surface, leading to the hot (about 20,000 K) chromosphere.

III. The corona
The chromosphere still has enough density to be able to radiate this mechanical heating, and maintain energy balance. But if we look further up, the density continues to drop, and eventually radiation is too inefficient to achieve an energy balance at all. This produces a kind of temperature runaway, until T reaches millions of K (at which point heat conduction by the fast electrons is able to carry away the added heat). This super-hot, super-low-density region is called the corona, and since the T is so high, we have to reassess whether the scale height in the corona, H_c, is still much less than R. In fact, it isn't, which has several important consequences.

First of all, when the scale height approaches R, the spherical geometry becomes important, and with it, the way g falls off like 1/r^2. So when we ask if the corona can be in a force balance, we must redo the above calculation for dP/dr, including that g falls off like 1/r^2. It is still a fairly simple differential equation, and it has the same form if we define a new distance parameter. Instead of using the distance above the surface in R units, call it x = 1 - r/R in the above derivation, we can account for the 1/r^2 falloff in g by defining our unitless distance parameter by x = 1 - R/r. That simple difference means that dx = dr*R/r^2 instead of dx = dr*R, which makes the integral solution easy when g falls off like 1/r^2 (try it), but more importantly, it means that x only goes to 1, not infinity, as r goes to infinity. This means that the solution for the density now reaches a finite value (not zero) at infinity, and since T is being held fixed in the corona (for simplicity, and because heat conduction is very efficient at high T), this means the gas pressure in the corona is also nonzero at infinity. Of course there is no infinity here, but the point is, if you get very far from the Sun in a solution like this, the density and pressure stop falling off much-- they kind of level out. If you compare observations of the solar corona to set the proper scale for the density and temperature, you find that the gas pressure that the corona levels off at is still much higher than the pressure in the interstellar medium. Parker used this to infer that the solar corona must be expanding-- there must be a "solar wind." Observations of ion tails being rapidly swept away from comets quickly confirmed this.

However, the magnetic fields that help heat the corona also constrain the plasma in the corona and can prevent it from being able to expand, in regions where the field is strong. These are called "closed field regions", filled with "magnetic loops", and the corona in these regions does not join the solar wind and can contain a higher density (and hence be more visible in the remarkable photos of the solar corona). So the corona has "open field regions", where the field lines have been swept out by the solar wind, and closed loops, where the plasma is forced to stay within the "tubes" created by the magnetic field. Energy releases that alter the shapes of the fields can then produce eruptions of this plasma, leading to "coronal mass ejections", which contributes plasma to the solar wind in a sporadic way. So the solar wind has more steady components, and more sporadic ones, and Earth sits in this wind and is affected by it, causing aurorae and magnetic substorms that can affect our satellites and power grids. Fortunately we have a relatively strong magnetic field for a rocky planet, which helps protect us from the solar wind, but many exoplanets might not be so lucky. Certainly, Mars was not, and this may have played a role in removing most of its atmosphere.

IV. Why the Sun does have a wind
In the 1950s, Eugene Parker reached an important conclusion-- the observed pressure in the low corona of the Sun, coupled with the very high temperature there (mechanically heated via that heat engine in ways that are still under study), there is no way the high pressure can fall enough to balance the pressure in the ISM. This might seem surprising, given the above argument that density (and pressure) falls off rapidly above the solar surface, but that argument applied for the small scale heights implied by the lower temperatures in the photosphere and even the chromosphere. At coronal T, the scale height starts to approach the scale of the solar radius, so we can no longer use a plane-parallel treatment. If we use spherical coordinates instead, gravity has a limited range in which to induce a pressure drop (say, a few solar radii, perhaps 10 at the most), so if the heating can keep the corona hot over just that much distance, the pressure will eventually reach a constant value that is still much higher than in the ISM. Dropping T outside that domain where gravity is acting does not help any longer, there will always be an overpressure relative to the ISM, so the corona must expand.

This is the solar wind, and because it is due to the high gas pressure maintained outside the solar surface, it is called a gas pressure-driven wind, or a "Parker wind." Parker found a simple constant-T solution that reaches supersonic speeds of order the escape speed from the solar surface, and importantly, this solution depends only on the assumed T and not at all on the mass-loss rate. The density is decoupled from the velocity because density is the source of the driving pressure force, but also the target of the gravity that curtails it, so in the end density does not matter. So we can understand the velocity of the solar wind without understanding how dense it is, or how high is the mass-loss rate. The latter requires knowledge of the rate of heating, which so far we can only try to observe but is difficult to derive from first principles.