This crops up everywhere in statistical tests, and is used to calculate the p value. It is a fairly deep mathematical topic and we need not go fully into it here. Broadly speaking, the larger the sample size, the larger the df: the smaller the sample, the smaller the df. However, this is modified by the number of groups you have and the parameters being estimated. A small df makes it more difficult to detect significance.
In statistics, degrees of freedom (df) are generally calculated as the sample size minus the number of estimated parameters. So as an example, the distribution has -1 df since we estimate the sample's standard deviation. Furthermore, since we define and since Thus knowledge of only the first -1 of their values also specifies so there really are only -1 differences that are free to vary. Thus dividing by -1 gives the average of the freely varying squared differences between the 's and . Of course, when becomes very large, there is very little difference between dividing by -1 versus . Another compelling reason for dividing by -1 is that when we observe the elements of a random sample, from a population, it is not true that 2 is equal to the population variance . If we were repeatedly to take random samples of the same size and compute 2 for each of them, the long-term average of these 2 values would be , which is the basis for using 2 as a reasonable estimate of . Dividing by -1 for small samples especially, gives a more conservative estimate of the population variance.