A/D 10 bits in Silicon Laboratories C8051Fxxx ,interrupt
It's simple digital filtering. The average of 32 conversions (usually the last 32 conversions) is taken to reduce the effects of ADC input noise on the final converted result.

If electrical noise or other interference can affect the voltage going to your ADC, the converted value will also be affected and you won't get the true value you wanted. By taking multiple readings and averaging, the effect of temporary noise or of white noise can be greatly diminished or removed.

Digital filters are a subject in themselves and the actual parameters of the averaging, such as the sampling rate, interval between samples and the algorithm for combining them, against the ADC input frequency range and type of signal are deep and involved.

But for basic, low-frequency and slowly-changing signals like pot' or photo-detector sensor readings, a simple filter like this can be easy to implement to avoid action being taken on false conversions.