What is a Glacier?
A glacier is a slowly flowing mass of ice with incredible erosive capabilities. Valley glaciers (alpine glaciers, mountain glaciers) excel at sculpting mountains into jagged ridges, peaks, and deep U-shaped valleys as these highly erosive rivers of ice progress down mountainous slopes. Valley glaciers are currently active in Scandinavia, the Alps, the Himalayas, and in the mountains and volcanoes along the west coasts of North and South America. The amazing, jagged landscape of New Zealand’s Southern Alps is also courtesy of the erosive power of glaciers. The lighting of the signal beacons in the movie The Lord of the Rings – The Return of the King  captures this famous landscape.
Continental glaciers (ice sheets, ice caps) are massive sheets of glacial ice that cover landmasses. Continental glaciers are currently eroding deeply into the bedrock of Antarctica and Greenland. The vast ice sheets are incredibly thick and have thus depressed the surface of the land below sea level in many locations. For example, in West Antarctica the maximum ice thickness is 4.36 kilometers (2.71 miles) causing the land surface to become depressed 2.54 kilometers (1.58 miles) below sea level!  If all the glacial ice on Antarctica were to melt instantaneously, all that would be visible of Antarctica’s land surface would be large and small landmasses with scattered islands surrounded by the Southern Ocean
How Do Glaciers Form?
A considerable amount of snow accumulation is necessary for glacial ice to form. It is imperative that more snow accumulates in the winter than that which melts away during the summer. Snowflakes are hexagonal crystals of frozen water; however, layers of fluffy snowflakes are not glacial ice…not yet at least.
As thick layers of snow accumulate, the deeply buried snowflakes become increasingly more tightly packed together. The dense packing causes the snowflakes to take on rounded shapes as the hexagonal snowflake shape is destroyed. With enough time, the deeply buried, well-rounded grains become very densely packed, expelling most of the air trapped between the grains. The granular snow grains are called firn and take approximately two years to form. 
The thick, overlying snowpack exerts tremendous pressure onto the layers of buried firn, and these grains begin to melt a tiny bit. The firn and meltwater slowly recrystallize, forming glacial ice. This transformation process may take several decades to hundreds of years because the rate of glacial ice formation is highly dependent upon the amount of snowfall. (The recrystallization process means that glacial ice is really a type of metamorphic rock.)
How Do Glaciers Flow?
A glacier begins to flow when a thick mass of ice begins to deform plastically under its own weight. This process of plastic deformation (internal deformation) occurs because the ice crystals are able to slowly bend and change shape without breaking or cracking. Plastic deformation occurs below a depth of 50 meters (164 feet) from the surface of the glacier. 
Thick glacial ice is quite heavy, and the great weight of the glacier may cause the ice along the base of the glacier to melt. Melting occurs because the temperature at which ice melts is reduced due to the pressure exerted by the weight of the overlying glacial ice. Heat from the Earth’s surface may also cause ice to melt along the base of the glacier. The process of basal sliding occurs when a thin layer of meltwater accumulates between the basal ice and the Earth’s surface. The meltwater functions as a lubricant allowing the glacier to slide more readily over bedrock and sediments.
If a great deal of slippery meltwater accumulates under the ice, the glacier may begin to advance very rapidly as a surge. Sometimes known as a galloping glacier, a surging glacier flows at a very rapid rate. For example, in the summer of 2012, Jakobshavn Glacier, located on the east coast of Greenland, was measured to be advancing at a rate of 46 meters per day (151 feet/day).  Jakobshavn Glacier is widely believed to be responsible for generating the large iceberg that ultimately sank the Titanic in 1912.
What Are the Zones of a Glacier?
The area of glacial ice formation is called the zone of accumulation. In this zone more snow accumulates each winter than that which melts away during the summer. Buried accumulations of snow turn into firn and eventually recrystallize into glacial ice. Glacial ice flows away from the zone of accumulation when the thick ice deforms plastically under its own weight. In a valley glacier the ice flows downslope from the zone of accumulation, while for a continental glacier the ice flows laterally outward and away from the zone of accumulation.
The area of a glacier that experiences a greater amount of melting than glacial ice formation is called the zone of wastage (zone of ablation). In this zone, as the ice melts away, bits of sand and gravel on the surface of the glacier are left behind. It is important to note that glacial ice is always replenishing this zone as glacial ice continues to flow from the zone of accumulation.
The line that separates the zone of accumulation from the zone of wastage is called the snow line (equilibrium line). The snow line may be visible at the end of summer between the clean icy surface of the zone of accumulation and the dirty, sediment-covered surface of the zone of wastage.
The upper 50 meters of the surface of the glacier, where the ice does not undergo plastic deformation, is referred to as the zone of fracture. In this zone the ice is brittle and only deforms by cracking, breaking, and fracturing. Crevasses are fractures or breaks in the ice that may be hundreds of meters long and up to 50 meters deep. 
The end or toe of the glacier is called the terminus and is part of the zone of wastage. When the terminus of the glacier flows into a body of water, the ice at the toe calves or breaks off to form floating chunks of ice called icebergs.
John Muir wrote about one of his 1880 adventures in Alaska, when he and the camp dog, Stickeen, went on a lengthy hike up a valley glacier . On the return trip their way was barred by crevasses, and John had to walk a considerable distance until he discovered a precarious, narrow ice bridge spanning a deep crevasse. Understandably, Stickeen was quite reluctant to traverse the dangerous bridge of ice and John spent considerable time and effort coaxing the fearful dog to cross. Stickeen and John eventually returned safely to camp only to be accosted by his fellow campers who were quite upset with him. John had failed to let anyone know where he was going!
Why Do Glaciers Advance and Retreat?
Glaciers have a snow budget, much like a monetary bank account. The more money deposited into a bank account, the larger the account grows. However, if more money is removed than is deposited into the account, the amount of available money is much reduced. Glacial ice advancement and retreat is quite similar.
When more glacial ice forms in the zone of accumulation than that which melts away in the zone of wastage, the glacier will grow and advance. The terminus of an advancing glacier will progress farther away from the zone of accumulation and thus lengthen the glacier.
A glacier retreats when more ice melts away during the summer than that which forms during the winter. The glacier reduces in size as the ice in the zone of wastage melts. The retreating glacial ice never actually flows backwards; the ice simply melts away faster than is replenished from new glacial ice formation in the zone of accumulation.
If the amount of glacial ice formation in the zone of accumulation equals the amount of melting in the zone of wastage, then the glacier does not advance or retreat. While the ice within the glacier continues to flow away form the source toward the terminus, the toe of the glacier will stand stationary because the glacial ice budget balances between the two zones.