As far as we know, molecules and atoms escaping into space comes due to the solar wind. Somehow the solar wind activates these atoms and carries them off into the distant vacuum, ad infinitum presumably though (I would imagine) limited by the heliopause.
[edit, benefiting from convo: mechanisms on atmospheric escape, to varying degrees of verification)
• https://en.wikipedia.org/wiki/Atmospheric_escape
• https://en.wikipedia.org/wiki/Hydrodynamic_escape ]
Absent that, our treasured atmospheric molecules would have to autonomousy achieve escape velocity, some 22 km/sec , with no outside assistance. A difficult feat. And so, resident atmosphere.