We've found evidence that Mars once had liquid water. Some scientists believe that it may have once had a thicker atmosphere, which could have warmed the planet and protected it from dangerous solar radiation. Together, all this might have made it possible for Martian life to evolve long ago.
If this was the case, then at some point, the atmosphere must have been stripped away, the planet must have cooled, and all liquid water must have frozen into ice.
What did that process look like? This NASA video, by Michael Lentz, gives you an idea:
The rendering shows a wet, warm Mars of four billion years ago — relatively soon after both it and Earth were formed — turn into the cold, dry planet we know today.
We're still not exactly sure how that happened. It may have been driven by the cooling of Mars' iron core, which would have caused its magnetic field to dissipate, exposing it to solar radiation that strips away atmosphere. Additionally, the larger number of asteroid impacts that occurred in the early Solar System might have exacerbated things, further removing atmosphere.