I've read that Mars could retain an Earth-like atmosphere because, while it's stripped away by the solar wind, it would happen over tens of millions of years; any remotely plausible terraforming attempt would be able to replenish it much faster than that.