Short answer: the table x = 1, 2, 3, 4 with f = 3, 5, 2, 1 has 11 observations, a mean of 2.0909, a mode of 2 and a median of 2. The mean is 23 ÷ 11, not 2.5, because the value 2 appears five times.
Why counts matter
Averaging the four values gives 2.5; weighting them gives 2.09. On a 100-unit question that 0.4 difference is the whole mark, and it comes from treating the frequency as a weight rather than a separate column to ignore.
Worked example
Test scores of 2, 4, 4, 4, 5, 5, 7, 9 have mean 5 and a population standard deviation of exactly 2. That is the same answer the statistics calculator gives when the values are typed out one by one, which is the check that the weighting is right.