The participants were seeded by their FIDE rating: the highest rated player (Magnus Carlsen, 2822) got #1; Wesley So, rated 2810, got #2, all the way down to Oluwafemi Balogun (2255), seed #128.
In the first round, the player with number x plays against the opponent with number 129 - x. So 1 vs. 128, 2 vs. 127, and so on.
In the second round, assuming the stronger player (with the lower number) advances, the player with number x plays against the opponent with number 65 - x. So 1 vs. 64 (this actually happened) and 9 vs. 56 (but this became 9 vs. 73 since 73 beat 56).
The 'target sum' for the third round is 33, for the fourth round 17, and so on until the final where #1 is supposed to play against #2.
This all is a standard seeding mechanism used in many sports (sometimes with slight variations); actually, in most cases, only the top n% (25% is common) of the players is seeded and the rest are paired randomly. This tournament was 'completely' seeded, which is relatively rare.