How are "premade" lobbies matched against opponents?

Zileas, design director for LoL, explains:

The system guesses how good you are based on who you beat and who you lose to. It tries to make matches where it thinks you have a 50/50 chance of winning.

It knows pre-made teams are an advantage, so it gives you tougher opponents when you are in a pre-made team. We did fancy math to make the pre-made teams vs solo players matching fair. I even ran it by two math Ph.Ds and they said it made sense!

You can read the full shebang here. Basically, a custom ELO derivative is used to rank players and power the matchmaking system, so that you are paired with similarly ranked teams.