If they are moving away from the planet, they can disappear into space. As the molecules leave, the planet's atmosphere becomes just a tiny bit less. Over a long period of time, the atmosphere can slowly drift away. Atoms are especially liable to leave a small planet or moon. Small, low mass moons and planets have low gravity to begin with, so the atoms are not held to the surface very strongly.
Heat makes matters worse.
Mercury is a small planet, close to the sun. It has a day time high temperature of 350 degrees Centigrade, which would make the atmospheric atoms move rapidly. In addition, particles from the sun, the solar wind collide with the atmospheric atoms, speeding them up further and perhaps changing their direction of movement. Mercury has only about a third of the gravity of the earth, so it is easier for atoms to escape from Mercury. It is not surprising that Mercury has no atmosphere to speak of.