Glaciers form when snow remains on the ground throughout the year. As new snow falls on these deposits, it freezes into ice. Each new snowfall compresses, and protects, the previous layers. After about two years of this process, the snow becomes firn. Firn is the half-way stage between snow and glacial ice.
Snow continues to fall on the glacier - usually at the highest altitude. Gravity forces the snow to move, and compact, down the mountain slope. This gives rise to the 'flowing river' morphology of glaciers.
Further down the glacier, where it is a little warmer (and snowfall is less likely to occur) is the ablation point. This is where most of the melting and evaporation occurs.
For most glaciers, the processes of melting, evaporation and snowfall are balanced - the glacier can continue indefinitely. If some change in the melting or snowfall rate occurs, then the glacier will advance, or retreat. Extra snowfall will cause the glacier to grow and spread, whereas excess melting will cause the glacier to shrink.
By comparing current observations to historical records, scientists can infer changes to local (and global) climate conditions.