In the centuries after Galileo's discoveries, the Moon was extensively studied by astronomers using telescopes. When a star was eclipsed by the Moon, it vanished suddenly and its light showed no refraction or absorption by an atmosphere. The location of that point allows astronomers to deduce the mass of the Moon, and from that, the pull of the Moon's gravity. Gravity is important for the retention of an atmosphere. It holds an atmosphere down, while heat is what can make it escape.
Heat is atomic or molecular motion.
In a hot solid or liquid, it can be viewed as a shaking motion of atoms or molecules around their average position, like the rustling of leaves in a wind. The higher the temperature, the more vigorous the motion, until the material boils or evaporates, at which point its particles shake loose altogether. According to that distribution, a few molecules always move fast enough to escape, and if they happen to be near the top of the atmosphere, moving upwards and and avoiding any further collisions, such molecules would be lost. Water evaporates easily and once in gas form, is quickly lost by the same process. The vast majority of craters probably date back to the early days of the solar system, because the lava of the maria has very few craters on it, suggesting it flooded and obliterated older ones.