The climate on Earth changes over time. The climate on Mars changes too! The orbit of Mars changes a bit, and so does the tilt of the spin axis of Mars. Those cause changes in the climate on Mars. Sometimes it has been warmer. Sometimes it has been colder. Some scientists think Mars had an ice age from about half a million to two million years ago. This picture, by an artist, shows what Mars might have looked like during an ice age. The polar ice caps were much bigger than today!
Image courtesy of NASA/JPL/Brown University.