The first two rounds are basically random. The only thing that might make a difference is when you choose to race. I usually run very late in the round, like an hour before the next round starts, hoping to get weaker opponents. It seems to help sometimes, but there's no guarantee.
Now, for the finals, put on your tinfoil hat. There is definitely some kind of matchmaking system, but how it works is anyone's guess. Some people believe it's based on win rate, so on the second day of Round 2 they intentionally lose races, hoping to get easier opponents in the finals. Others think it's based on team score, meaning you're matched against players with a similar average team rating. And then there are people who believe the opposite: the higher your win rate, the easier your opponents become.
Honestly, I think it's probably a combination of win rate and average team score.