Earth was able to retain an atmosphere because of its gravity. It isĀ the same force that keeps us anchored to Earth. Molecules in our atmosphere are constantly moving, spurred on by energizing sunlight. If Earth were much less massive, gravity's grip would be weaker.