How many such ways to group 2n students?

One way to come up with a pairing of the students is to line them up in a row (there are $(2n)!$ ways to do this) and call the first two people the first team, the next two people the second team, and so on.

However, different ways of lining people up will lead to the same pairing into teams. We have to figure out how many lineups give the same pairing. Given one lineup, how could you change the lineup and still get the same teams? There are two things you can do.

One is go down the line, and have some of the paired-up people swap positions; for example, the line ABCDEFGH could become BACDEFHG. As there are $n$ pairs, each of whom you either swap or don't swap, there are $2^n$ ways to choose which pairs to swap.

The second thing you can do is move people in groups of 2, so the same people remain paired up and in the same order relative to each other. For example, if the line is ABCDEFGH, the pairs are. AB,CD,EF,GH so the line GHCDEFAB gives the same pairs. As there are $n$ pairs, you can reorder those pairs in $n!$ ways.

So every pairing arises from $2^nn!$ lineups of the $2n$ people. There are $(2n)!$ lineups, so the number of pairings is $\frac{(2n)!}{2^nn!}$.

In a more advanced course this would all be phrased in terms of counting orbits of a particular action of a hyperoctahedral group or a wreath product. But the above is really all that's going on.