Mars, being smaller and further from the Sun, cooled rapidly and ceased tectonic activity. Hot spot volcanism lasted for some time afterwards, and created the huge volcano Olympus Mons. Planetary atmospheres are continually losing molecules into space. However, outgassing of volatiles from the interior by volcanoes can maintain the atmosphere. Mars is also geologically dead and has a very thin atmosphere.
Volcanoes maintain the atmospheres of the Earth and Venus.
The atmospheres of Venus and Mars are almost entirely carbon dioxide, while the Earth's atmosphere consists of nitrogen and oxygen. The oxygen originates as a byproduct of photosynthesis by plants. Almost all of the Earth's carbon dioxide was washed out of the atmosphere by rain and is currently locked up in carbonate rocks. Some is recycled back into the atmosphere by volcanoes. The atmospheres of Venus, the Earth, and Mars warm the planets to some extent through the greenhouse effect .