A glacier is a river of ice. It starts with a field of snow, usually high on a mountain. New snow falls on top, while older snow below is compressed. It becomes denser and recrystallizes as ice. Year-after-year, if winter snowfall is greater than summer melting, the stage is set for the snow field to become a glacier.
When the ice becomes thick enough, it deforms under its own weight and begins to flow downhill as a glacier. Speeds vary depending on conditions, but are typically slow: a meter (yard) or two per day, week, or month. As it flows, the glacier's front plows up rocks, soil, and (on Earth) vegetation. At the same time, the bottom of the glacier grinds across the landscape like coarse sandpaper, scouring it with rocks picked up in its path and carried by the ice. Glaciers on Earth vary in thickness along their course, but are usually several hundred meters (yards) thick at least. At the height of the last ice age, the ice sheets — mega-glaciers — in North America were a kilometer (3,300 feet) thick or more.
The flow in a glacier is always downhill and outward. Even when scientists speak of a glacier "retreating," the ice is still continuing to flow forward. What retreats is only the glacier's front or edge, which is melting away faster than the forward-moving ice can resupply. As long as the snow supply is greater than the removal of ice through melting or sublimation, a glacier will advance. But if these forces reach a balance, even temporarily, the front of the glacier will remain in place, but the ice within the glacier will continue to flow. It carries the debris — rocks, sand, gravel, clay — forward and dumps it in a ridge called a moraine (see below) at the point where the ice melts.
A few places on Earth (in Antarctica) have temperatures cold enough that the bottom layers of glaciers are frozen to the ground and do not move. The glacier can still flow, but only in the layers above the lowest ones. Scientists call such glaciers "cold-based," and they expect that the term describes a great many Martian glaciers.