The blood's positive and negative charges should roughly balance. The anion gap measures the negative charges you can't see — and a big gap means an extra acid is hiding there.
The anion gap is (sodium + potassium) − (bicarbonate + chloride), normally 8–14 mmol/L. It is most useful in metabolic acidosis. A normal gap suggests bicarbonate loss, such as diarrhoea or renal tubular acidosis. A raised gap suggests an added acid: lactate, ketones, urate in renal failure, salicylates or methanol, or 5-oxoproline from chronic paracetamol use.