What Is Matchmaking?

https://us.v-cdn.net/6030815/uploads/961/0FSCU893IVNC.png There was an error displaying this embed.

So, today I decided to play a game of huntress, and it took a little bit to get a match, and I get in. I play decently well, and I manage to get a 4k. Then, I look at the match, and realize, that I was up against a SWF, a good team, and red ranks. At rank 13. Why does this happen, honestly, what is the matchmaking, and why is it so inconsistent and unreliable?