ANOVA divides the total variability of the data into two parts: variability between the groups and variability within the groups. The F-test is then used to compare these variabilities. If the between-group variability is significantly higher than the within-group variability, it suggests that at least one group mean is different from the others.