ANOVA works by partitioning the overall variance observed in the data into components attributable to different sources. In a simple one-way ANOVA, the total variance is divided into between-group variance and within-group variance. A higher between-group variance compared to within-group variance indicates that the different groups (e.g., treatment groups) likely have different means.