The main difference between them is that ANOVA is used to analyze the differences among group means in a sample. Whereas kmeans analyze the differences among groups as well as inner cluster members.
The main use of ANOVA is to determine whether there are any statistically significant differences between the means of three or more independent (unrelated) groups.
The goal of this algorithm is to find groups in the data so as to perform operations and find patterns.