Earth has a magnetic field, that protects the atmosphere and oceans from the solar wind. Mars does not.
That is said to be why Mars has a thin atmosphere.
OTOH, Venus being closer to the Sun gets a lot more solar wind to blast away it’s thick soupy atmosphere, and also has no magnetic field to protect it.
I guess astrophysicists really can have it both ways...