You have to have a molten core to generate a magnetic field. A magnetic field holds the atmosphere in place. The core of Mars cooled down millions of years ago to the point where it’s atmosphere almost entirely dissipated.
“You have to have a molten core to generate a magnetic field....”
There you go.