All planets lose a small amount of atmospheric gases due to some atoms/molecules (even neutral ones) having an energy high enough to escape the gravitational field of the planet. This tends to affect lighter elements more as they have higher velocities at the same temperature.
This kind of thermal 'outgassing' is in principle the same as that producing the 'solar wind'.
The ejection of ions in the polar regions mentioned in this link are due to a slightly different mechanism. They are caused by electric fields (plasma polarization fields) in the ionosphere. But these in turn are due to the electrons not being gravitationally bound and thus being able to escape from the earth, hence creating a net electric field. They are only able to escape in the region of open magnetic field lines though i.e. near the poles. Again, also this is lastly a result of some particles being able to escape the gravitational field.
It is not too difficult to calculate the amount of gas that can escape the gravity field of the planet. Let's consider atomic hydrogen (mass m=1.6*10-24g} in case of the earth. The density at the height of about 400:km (above which the atmosphere can be considered collisionless) is about $n=10^5/cm^3$
The temperature can be quite variable between about $600K$ and $2000K$ depending on daytime and solar activity. Let's take a medium value of $T=1200K$ here. The height of 400 km would then make the radius at that level $R=6778 km$ and thus the total area of the sphere $A=4\pi R^2$. The escape flux from one square centimeter of that sphere is (assuming a Maxwell velocity distribution and considering that only half of the atoms (going upwards) can escape)
$$F_{esc} = \frac {n\sqrt{\pi}}{4 v_0} \int_{v_{esc}}^{\infty} dv * v*exp[-(\frac {v}{v_0})^2] =$$
$$= \frac{\sqrt{\pi} n v_0}{8} *exp[-(\frac{v_{esc}}{v_0})^2]$$
where $v_0$ is the thermal speed
$$v_0=\sqrt{\frac{2kT}{m}}$$
with $k$ the Boltmann constant, and
$$v_{esc}=\sqrt{\frac{2GM}{R}}$$
the escape speed from the planet with mass $M$ (=6*1027g for earth) with radius R and G the gravitational constant.
With the values as given this results in an escape flux of H atoms of $F_{esc}=4*10^7/cm^2/sec$ and thus a total hydrogen mass loss of $F_{esc}*A*m=0.4 kg/sec$. If you look at the Wikipedia page https://en.wikipedia.org/wiki/Atmospheric_escape#Earth , they give 3kg/sec for the earth's hydrogen loss, which is a bit more, but then this figure could be based on different physical parameters, especially as this depends very strongly on the temperature. With T=2000 K, the result would be already 4.4 kg/sec according to the above calculation. For other elements than hydrogen, the loss rate is much lower though due to smaller thermal velocities. Even at 2000 K , Helium for instance is only lost at a rate of 4*10-3 kg/sec and atomic oxygen even at about 10-18 kg/sec. This is all assuming a Maxwellian velocity distribution in the first place, which may or may not be an accurate approximation in the high velocity tail of the distribution.
In case of the solar plasma, there is the complication that the electrons are gravitationally practically unbound because of their small mass. This means they will escape freely until a state of equilibrium is reached where the sun becomes positively charged by such an amount that their escape rate is equal to that of the (much heavier) ions (i.e. both the electrons and the ions must have the same net potential energy). So ignoring the gravitational potential energy of the electrons, in equilibrium the equation must hold ($U_G$=gravitational potential energy, $U_E$=electric potential energy)
$$U_E= U_G-U_E$$
where the left hand side is the net potential energy for an electron and the right hand side for the ion ($U_E$ is negative on the right hand side because the positively charged sun will repel rather than attract the ions).
This equation obviously gives us
$$U_E=\frac {U_G}{2}$$
that is the electric field induced by the electron escape (plasma polarization field) effectively reduces gravity by 1/2 for the ions. In the equations for the calculation of the escape flux above, we have therefore to effectively reduce the solar mass M by a factor 1/2 (which reduces the escape velocity by a factor $1/\sqrt{2}$). Doing this and assuming an ion density of $n=10^8/cm^3$ at $R=740000 km$, one can match the observed flux/density of the solar wind at the earth with a temperature of $T=2.5*10^6 K$, which again seems a reasonable value. The total mass loss in this case follows from the above as $8*10^8 kg/sec$ which is also consistent with the value one can find quoted elsewhere.