We know, escape velocity of the earth is 11.2 kms-1. That means, in order to escape from the earth or in order to escape the force of gravitational attraction, a body is to start with a velocity of 11.2 kms-1 or 7 miles/sec.
There are different kinds of gases in the atmosphere of the earth. But lighter gases like hydrogen and helium are rare. The reason for this can be explained on the basis of escape velocity. At normal temperature and pressure, root mean square velocity (rms) of hydrogen molecules is about 1.6 kms-1. But at the time of creation of the earth, temperature of the earth was very high and during that time rms value was about 4 to 5 kms-1. Some of the molecules might have velocities 2 to 3 times than rms value. So, it is likely that hydrogen and helium gas at that time could have escaped from the atmosphere. So, most of these gases have gradually escaped from the surface of the earth.
We know, escape velocities of universal materials depend on their masses. Velocity of the sun is many times than the mass of the earth, hence escape velocity from the sun much higher. So, in the atmosphere of the sun lighter gases like hydrogen are available. Again, masses of moon, venues and other planets are much smaller than the mass of the earth, so their escape velocities are less. So, gases molecules have disappeared slowly.
So, it is clear that by applying gravitational law and by collecting experimental data and escape velocities of different stars, planets, satellites of the universe, we can get clear idea and knowledge about the presence of different liquids, gases and solids in those terrestrial bodies.