It has to do with degrees of freedom: you’re using the sample mean in the calculation, not the population mean, so you lose one degree of freedom when you compute (and then use) the sample mean.
A population has extreme large and small values that are less likely to be included in a sample (for bell-like distributions, anyway). So a sample you collect will usually be biased towards the mean, which underestimtes the SD and variance.
What I don’t know is: whether n-1 is derived from some mathematical principle or if it’s just a makeshift adjustment that everyone does to ‘fix’ the bias… anyone know?
It is derived from a mathematical principle: dividing by n – 1 ensures that the expected value of the (bias-adjusted) sample standard deviation equals the population standard deviation.