For example i've seen a premade where one had 1500 rating and the other was unranked, will the rest of the team be closer to the higher or the lowest? And what about the other team? Isn't matchmaking somehow unbalanced?
In extreme brief:
- The team will be placed at an average of the individual Elos plus a small bonus. If there are only two people, this means you'll be closer to the higher of the two than the lower. For all other cases, it depends on the various Elos involved.
- Matchmaking will evaluate the team's average Elo and find another team with the same (or close) average.
- Not really; due to the averaging and bonuses, it's difficult to genuinely unbalance the system in a way that's meaningful.
And now, the "TS;DR" version ;-):
Source, from which I paraphrase extensively.
There are three cases worth considering (all other cases are some amalgam of these):
- Everyone's in solo-queue
- Some arbitrary number are in a pre-made team between 2 and 4 players (or only 2 for Twisted Treeline)
- A five-man pre-made team (or, in the case of Twisted Treeline, a 3-man)
The goal of the matchmaking system is to find what is approximately the team's Elo and find a team with a comparable Elo. That translates into having a 50-50 chance of either team winning. The longer you're in queue, the greater the difference between two teams' approximate Elo is allowed, thus the greater difference in your estimated percentage chance to win.
At the root of the question is how that number is determined.
In the root-case of everyone being in solo-queue, in any game type, the system first locates other people approximately your same Elo then loads you all into a team and averages the Elo of each member. Once it has two teams "in queue" with approximately the same team Elo, it will match them into a game.
On the other extreme, if you're a 5-man pre-made team, the same process is followed except the team is already full (so it doesn't need to locate other players for the team), and the team Elo gets a small bonus (described below). In ranked games, you will only be matched against another 5-man pre-made team. In normal games, I believe (and ought be corrected or confirmed with an edit and source citation) that 5-man pre-made teams are preferred but you don't necessarily get matched with one.
In the middle, things are slightly more complicated. Once you enter a queue with teammates, everyone's Elo is adjusted to be the same value. That value is the average of everyone's Elo plus, again, a bonus depending on several factors (again, see below). Once you're all in the pool of active game-seekers, it locates other players who have approximately the same Elo as your adjusted Elo. Obviously, when it examines another player's Elo it could be looking at their adjusted Elo, too, in the case that you have a team of 3 and a team of 2 being put on the same team of 5. Once it has created a full team of five, it does a final averaging of the Elo everyone entered the team time (adjusted or not). That final averaging is your team's Elo. It then locates another team with the same team Elo and BAM: puts you in a game.
The question now is what kind of bonuses you get. Riot won't release the exact values, and there are a number of cases to consider. I'll let the a different source do the talking:
...Riot performed analysis on several hundreds of thousands of games to identify how much of a skill advantage this gives people, and found that a variety of factors influence how much of an advantage being a pre-made is, ranging from the size of the pre-made (2,3,4 or 5 people), to the skills of the players involved, to combinations of pros and newbs, to other more subtle factors that must be used as well. Having found these advantages, it is known how much we need to boost a rating by in a team to make a fair match, and apply the appropriate, mathematically justified adjustment. These results in some cases are very surprising (while still appearing correct in the statistics)
- 5-man pre-mades are only moderately stronger than solo queuers
- Partial pre-mades are only a little bit of an advantage.
- New players don't benefit much from being in a pre-made, while experts benefit a lot.
Finally, with all of that information, we can address the question of "Isn't matchmaking somehow unbalanced?"
"Unbalanced" we can safely take to mean that it grants advantages to one team or person over another. Since virtually any "person" advantage is also a "team" advantage (you don't gain or lose Elo individually; only as a whole team) I think it's safe to say we don't need to cover them individually. One assumption I am making is that Elo is a fair approximation for skill. Disagree all you like, but some assumption of the system's validity needs to be made in order to discuss it.
Riot obviously has gone through significant effort to make sure that the system is difficult to abuse. I also won't speculate on measures we're not fully aware of (Newbie Island and abuse detection). However, two people of inordinate skill differential (say, 0 and 1800) would end up at 900 + some arbitrary bonus if they queue'd together. If you have three people at 0 and one 1800, you would get 450 + some (larger) bonus. An 1800 Elo player can generally be expected to carry a 450 Elo game and a 0 Elo player is unlikely going to be able to throw it. In this sense, the system as presented can be abused.
If we take a more realistic case, however, of an 1800 Elo player helping a 1200 Elo player (let's say their Elo has stabilized; I know you get significant (40+) Elo gains and losses early on), the difference is less pronounced. That would put them at 1500 Elo, plus a bonus, which a 1200 Elo player can certainly throw due to the ability of the 1500 Elo players to take advantage of their mistakes (something that 450 Elo players have a harder time doing). However, the 1800 Elo player is going to have a harder time carrying the game alone.
You can see that, even without extra knowledge of the system, it's hard to make the situation measurably "unbalanced" for the majority of cases.
The ranking system will put together a team of players each with their ranging ELO values. It will general try and keep people similar to each other but it does not always happen.
After that is done, it will simply look for another team that is similar and it will keep increasing the amount the teams can be different until it will find a match. This searching scales as time passes under the theory of getting into a game sooner rather than a more perfectly matched game is more desirable.
You can search the posts here for a more clear explanation of ELO if you are interested to take it further :)
Hope this helps.