There are usually a large number of competitors in such an event, and in order for all the competitors to have the same environmental conditions, which, among other things, include temperature, wind speed, rain or shine, etc., they need to start at the same time and same place and proceed along the same course. But the large number of competitors makes it impossible to fit all of them at the same starting line. So the athletes stand in a pack before they begin: some are behind others, sometimes by dozens of meters or more, depending on the number of competitors.
The tradition is that all the athletes start at the same time, the gun time, and use the same starting line and same finishing line as those in the front of the pack. This means that those in the back of the pack have to run an extra distance. One's position in the pack at starting is determined either based on his previous records, or chosen by him based on his own expectation and etiquette. Usually, the best athletes take the front positions.
Modern electronic technology has made it possible to get the time lapsed for each individual athlete from his crossing the starting line to his crossing the finishing line, the chip time. This is also called transponder timing. However, this has the disadvantage that the race finish is not simultaneous, so the race results do not match the finish line order. Other ways to avoid disadvantage towards those in the back of the pack are individual starts (where athletes start one at a time) and interval starts (where athletes are released in small batches). Chip time is normally not used to determine top positions. The first to reach the finish shall be the winner.
In cross country skiing, on elite level, the tradition is individual start. Each athlete starts at his/her own predetermined time. Mass starts are used more often after 1990, partly because of TV influence. It creates better summaries for TV stations that do not want to show the entire race, and for viewers who do not want to see all.