According to geologic evidence there (paleo-magnetism of lava basins), when Mars lost its molten core billions of years ago the planet was no longer able to generate a magnetic field. Without a magnetic field there is no protection from atmosphere-destroying/stripping cosmic ray particles from space. Without an atmosphere to contain heat and moisture, the planet naturally cooled off to where it is today. It does, however, have seasons, due to the fact that it rotates on a tilted axis as Earth does, and so temps do fluctuate there seasonally.
...Mars does have a weak atmosphere.
And they know it had a magnetic field at one time because really ancient lava rock there is magnetically aligned to some planetary-scale field, while lava that formed much later as a result of meteor impacts is not magnetically aligned. So, sometime in between, Mars lost its magnetic field.