In the 1800's, the format of chess tournaments was often a "Round Robin", where each opponent played all of the other opponents. This is the best way of determining playing strength; however, the number of rounds needed are prohibitive for a large number of entrants. For example, for 32 players, there would be 31 rounds using the Round Robin format. And for many scholastic sections, it's not uncommon to have 100-300 players, which would require from 99 to 299 rounds!
Today, in order to host a large number of players in a single weekend, the "Swiss System" is used. Invented by J. Muller and first used in a chess tournament at Zurich, Switzerland, in 1895 (hence "Swiss" system), this pairing system was introduced in the United States by the legendary George Koltanowski.
In the Swiss system, after the first round, players are placed in groups according to their score (winners in the 1 group, those who drew go in the 1/2 group, and losers go in the 0 group). So each round, you play someone with the same score as you. Since the number of perfect scores is cut in half each round, it doesn't take long until there is only one player remaining with a perfect score. (The actual number of rounds needed to handle the number of players in the section is 2n, where n = the number rounds. So for 32 players, 5 rounds are needed to determine a clear winner, since 25 = 2x2x2x2x2 = 32. After 1 round, there would be 16 with 1-0; after 2 rounds, only 8 would have 2-0 scores; after 3 rounds, 4 players would have 3-0 scores; after 4 rounds, 2 players would score 4-0; and after the 5th round, only 1 player would have a score of 5-0). In actual practice, there are usually many draws, so more players can be handled (a 5 round event can usually determine a clear winner for a section of at least 40 players, possibly more).
The current system "seeds" players according to their rating. Players are listed from highest rating to lowest, and unrated players are listed at random at the bottom, then assigned a pairing number for the tournament. The top half of the list then plays the bottom half of the list (if there are 32 players in the section, #1 plays #17, #2 plays #18, etc.), alternating colors (if #1 plays white, then #2 plays black and #3 plays white, etc.) The starting color for #1 is picked at random. In subsequent rounds, colors are alternated if possible. A player might be paired the same color twice in a row if necessary, but is usually not paired the same color three times in a row, unless absolutely necessary (for example, both players have played the same color twice in a row, and there is no other logical pairing).
After each round, players are placed in scoring groups, or "packs", according to their score. Then the above process is repeated within each score pack. If a scoring pack has an odd number of players, the lowest pairing number within the pack plays the highest pairing number in the next pack down (for example, if there were an odd number of 1's after the first round, the lowest rated 1 would play the highest rated 0.5, if there were any players who drew the first round, or the highest rated 0 if there were no draws the first round). So ideally, you're either playing someone with the same score as you, or usually no more than 1/2 or 1 point lower or higher than your score.
Pairing adjustments are made if both players are due the same color, unless it cannot be avoided. Also, in tournaments where team scores are kept, players from the same school are usually not paired against each other. Directors have the discretion of overriding this, however, if all or most of the players within a section are from the same school.
In any event, players are never eliminated in Swiss System or Round Robin tournaments. Also, you may not play the same player twice within the same tournament. If there are 5 rounds, you will play 5 different players. If there is an odd number of players in a section, the lowest rated player with zero points will receive a 1 pt. "bye". (Unrated players should not be given a bye unless there are no rated players with zero points. This helps unrated players play more opponents to give them a more accurate rating). If there are no players with zero points, then the lowest rated player in the lowest score group gets the bye, etc. A player cannot receive more than one bye during a tournament.
The drawback of the Swiss system is that it's only designed to determine a clear winner in just a few rounds. However, there could still be ties if the last two players with perfect scores draw against each other. Also, the strength of the players between the top and bottom players is hard to determine. There could be many players with 3-2 scores, and it's hard to say which player is better than the others, or whether a player with 3.5 points is better than a player with 3 points. To help determine the order of finish, a tiebreak method is usually implemented.
If there are more players in a section than the number of rounds can handle (to determine a clear winner), then "accelerated" pairings are an option for the director.
Players are seeded as above, but in the first round, the players from the top 1/4 of the wallchart play the players in the 2nd 1/4 of the wallchart. The 3rd 1/4 plays the bottom 1/4. Then in the second round, the winners in the top 1/2 of the wallchart play each other, the losers in the top 1/2 play the the winners from the bottom half of the wallchart, and the losers from the bottom 1/2 of the wallchart play each other. (The reasoning is, the higher rated losers from the top half should beat the lower rated winners from the bottom half, which would cut down the number of perfect scores faster). After the 2nd round, all the players are lumped together within their score packs, as in the traditional Swiss method, and the tournament continues as a regular Swiss. The only difference is, there should be 1/2 as many players with 2-0 than there would have been with a straight Swiss System tournament. So up to 64 players could be handled in a 5 round tournament.