Gravity is the only force holding our atmosphere (scary, no?). Actually, the Earth's atmosphere does escape molecule by molecule at the boundary layer called the exosphere, but not enough to make any difference. Yes, as well, to the amount of gravity being dependent on the mass of the Earth, Mars, apparently at one time, had more of an atmosphere than it does today, but was lost, according to current theory, because it was, over time, "blown away" by solar winds (not actual winds, but charged particles emitted by the Sun). The theory is this happened on Mars but not Earth because Mars doesn't have the magnetic fields to protect it as does Earth, but that's the answer to another question, no?
Another theory is Mars atmosphere, being mainly carbon dioxide may also have been turned into carbonate. It's been mineralized and has been accumulated in the Martian rocks.
Good question!