Yes, I agree, the collapse IS due to gravitational attraction, hence my wondering why hydrogen would escape into space (unless it had magically lost it's mass!)
It shouldn't make any difference whether there are "knots of sufficient mass" or indeed a tenuous gas verging on vacuum, as found at the edge of the atmosphere, as gravity is a cumulative and long-range effect.
Any massive particle (e.g. hydrogen or helium atom) within range of a large body (like the Earth) will be attracted, not repelled.