Mars they think billions of years ago had a much thicker atmosphere. They say it was destroyed by cosmic radiation when the planet lost its magnetic field and could no longer repel the charged particles. It lost its magnetic field when the core cooled down to the point where it could no longer generate a field.
They know this because magnetic minerals in the ancient bedrock are aligned in one direction while similar minerals in much younger lava rock are not. Both sets of rock were once molten and so minerals were free to align to a magnetic field, if one were present.