My understanding is that the match-making system is based on several things, including, but not limited to: your MMR, server preference, party size, and language.
Ideally, the system will match you 9 other plays of exactly the same MMR, server preference, party size and language. Clearly this is a rare occurence, so the system looks for the best matches, and if it can't find them, it lowers its requirements in terms of the quality of the match, and looks again. You can see the progress of this search in the search-range graphic while you are finding a match - the wider the light-blue bar, the bigger the range in mmr etc the system is willing to accept to match you to a game. Thus, the longer you are searching, the wider the range of different players you will get - hence it being preferable to play at peak times for your region, rather than in the morning for example.
It's probably worth mentioning that while your MMR is key in the above system, it's been shown that Language is given a significant weighting as well - I've heard stories of 5-stacks that will deliberately select, for example, in the hope that they will be matched with low-mmr teams that they can easily beat.
As another interesting side note - my understanding of how the match-making works with MMR, is that it will skew the "party MMR" according to each players MMR - BUT!! If you have one player that has higher skill than the rest of your team, it will skew the party MMR more significantly towards his/her MMR, on the basis that they will have a great impact. By example - if you have 4 players with a 2000 MMR, and one with a 3000 MMR, you might expect the party MMR to be 2200, as an average. The actual figure is taken to be much closer to 3000 (though I confess I do not know how much by), to prevent said 3000 MMR player taking mid, and dominating the match.
Hope this helps, sorry if I've rambled!!