ANOVA: how can variances tell us if the means are different

in anova (specifically one-way anova), the variance within each group and the variance between groups are calculated, and then their ratio yields the f-statistic, which tells us if the population means are the same or different.

question is, how does the ratio of the variances tell us if the means are different? for instance, if i have 2 normally-distributed populations that have the same standard deviation but different means. wont the f-statistic still be close to 1, which indicates that the means are the same?