Thiem actually hasn't qualified yet, he still has one more qualifying game to win in order to make it to the main draw, and his next match is against a better ranked player Kokkinakis (no. 93).
The draws aren't random by any stretch they happen according to rankings or seeds for the tour, even for the qualifiers they do have seeds for it as well. So whoever wins the last seeds position from the qualifiers by default gets to play the 1st seed for the tournament. For ATP 1000 events like the Madrid open most are usually a 64 man tournament with the top 8 seeded getting a bye for the first round (some have expanded to 96 players, meaning more bye for more players in the first round, e.g Indian Wells Open), meaning there are supposedly 58 players in total, the seeded 32 players are default by their atp rankings for those who are eligible for the tour, so the remaining 26 slots are battled for in the tournament qualifiers, in some cases it could be fewer, if the tournament features Wild Cards (WC) or players with protected ranking (PR), the latter as the case with Nadal currently is. Nadal are surely going at loggerheads again, provided Nadal wins his first game
Thank you for the detail. I know I could look it up myself but it's nicer to get someone who knows explain it. I did watch a lot of tennis when I was younger, but never really got into the details of competitions.
I got lost with ranking system already recently, and can't be bothered to catch up. I knew seeds were important (and ranking) but I thought this was only for the protection of top seeds. I always thought qualifiers anyway were randomly drawn. So now I understand this is not like a football group draw. Got it.
Oh yeah and Thiem didn't make it. Goodbye.