The way I'd heard it, the planet Earth is losing it's atmosphere, slowly. The time scale, in Earth's case, just happens to be long enough for life to form and evolve. There are some other tricks, Mars for example is very small. It lacks enough mass to generate a high enough gravity to hold much atmosphere. Maybe there was life there too, once. But it couldn't get far, before the atmosphere thinned.
Also, Mars has a cool interior. It may have had plate tectonics once, but it doesn't now. That's another trick the Earth uses, subduction of plates into the mantle vaporizes carbonate rock, which comes back out in volcanoes, elsewhere. On Mars, once a gas becomes a solid compound, it stays in a rock on the surface.
Even Venus, warmer than the Earth, has a dense atomsphere, it may not have plate tectonics to regenerate it's atmosphere from surface rock, but it may catastrophically regenerate it's surface.
I'd heard, apocryphally, that if we could, either magically or by applying suitably advanced technology, transport enough nitrogen and oxygen, to give Earth's moon a dense atmosphere, it would be lost much faster than Earth's would -- but still, millions of years would pass. Oh, life wouldn't evolve there, but human civilizations would likely die out before they noticed.