The formation comes from the fact that it is harder to cycle at the front of a group than in the shelter of another rider. The rider behind enjoys the slipstream of the rider in front. If one rider were to stay at the front all the time, he would tire and the whole group would slow down. If the lead is rotated, the effort is distributed across the group and the speed can be higher or the individual effort less.
This effect is very significant - up to a 40% reduction in effort for the slip-streaming riders while the lead rider also benefits from reduced drag (somewhat under 10%) due to the air not closing up after him.