Why Tukey's HSD uses Mean Squares within the samples not between the samples?

statistics

#1

Hello,
I have been doing Statistical Inference on Udacity.For calculating margin of error in Tukey’s HSD we use mean of squares within the samples why not between the samples?
Thanks