When you make an ice cube, you invariably trap very minute air bubbles within the ice. The humble ice cube effectively is acting as a time capsule, holding air inside it from when it was formed. Air contains many gases, some of which are suggested to enhance global warming.
As polar ice can be thousands of years old, climatologists work within these remote regions to study the ice for changes in composition of atmospheric gases over thousands of years
The data is collected from ice cores, effectively long tubes of ice taken from vertical sections of glaciers. As each season produces a different layer of snow, the ice cores can be 'read' quite accurately, a process similar to dating sedimentary deposits in riverine areas or the determining seasonal variation using growth rings of trees.
Each year has it's own record of gases within it, therefore scientists can use this record as a monitoring tool for dramatic changes in our atmosphere. One such dramatic change has been the rapid rise in carbon dioxide levels found within the these ice cores, a gas strongly suspected as causing the most damage in trapping excess solar heat energy within our atmosphere.
More on global warming, also known as the enhanced greenhouse effect
Reference:
Brady, J. E. & Holum, J. R. (1993). Chemistry. The Study of Matter and Its Changes. John Wiley & Sons, New York