That greatly depends on your game, the cheating potential etc.
Generally you have two/three types of network infrastructure (maybe more which I don't know):
You have the authorative central server approach and you have the decentral peer-to-peer approach.
Take Counter Strike: Global Offensive as an example: There you have an authorative server and they actually have two types of lobbies: The lobby which simply lists all available (third party) servers. That way the matchmaking is done manually by the users. This is fine if you don't require a fixed amount of players, if you want users to host servers (helps you cut cost), etc.
Then there is the matchmaking which assigns 2 teams to a random internal server. This is needed because you get ranked in a scoreboard. User Servers would open up cheating possibilites (modded servers). Technically you could also assign people to random user servers for your game but it might be strange if they enter a modded server and they won't build a community on a server if you want a bit of an social aspect. Here you also have to implement private lobbies so a group of friends can queue up for the matchmaking.
Then there is the brand new "For Honor" System. It uses Peer to Peer networks so they don't have server costs. This also works because they only have 3 vs 3 matches, possibly 5 vs 5 as maximum. For this you would need UPnP Setups, lot of troubleshooting with players and open gates for cheaters. Technically they seem to have some kind of server for sync/validation, but the main traffic seems to be synced inbetween players.
"Test Drive Unlimited 2" also was a P2P Game: You notice quite some lagging even if you both are in the same LAN. If you were to create a trading card game thing, then it wouldn't matter.
But that all isn't match making itself. If you have many maps and game styles you can go with manual matchmaking and let the users decide manually because else you might have problems with a small user base (4 game modes x 10 maps -> 40 possiblities -> 160 Players needed so you can find a match for any game mode). You could also have some rank-based thing to rate based on the skill and such. I think it depends on your game and what you want to achieve. There are many talks on that though