One of the many dangers of having a chronically high blood glucose level is that proteins get glycoylated (a glucose gets 'added' to them). This can affect the protein's function, and this glycosylation is believed to be a major factor in explaining why uncontrolled diabetes is so bad for you.
HbA1c is just one of these many glycosylated proteins - it's actually your haemoglobin molecule that's had glucose added to it. The higher the blood glucose level, the more proteins are glycosylated, and so the higher the HbA1c. Since the process is irreversible, and since haemoglobin hangs around inside a red blood cell for about 120 days, the HbA1c is a good measure of CHRONIC (over the last 2-3 months) glucose control.