In Ranked Solo and Duo queue, the pick order is by Solo/Duo Elo. Thus, if you have 2nd pick, you have the second highest Elo on your team.
In Ranked Premade, the person who invited everybody is Captain and picks first, and the rest are, according to several forum posts, ordered by a hidden Ranked Premade Elo based on wins/losses while in that specific queue.
Season 3 introduced the concept of Leagues and League Points to mark progression in Ranked. Elo still exists as a hidden value called MMR, standing for Matchmaking Rating. TheIn Season 3, the pick order in Ranked, both Solo/Duo and Premade, ignores Leagues/LP, and is entirely dictated by MMRentirely dictated by MMR. Therefore, a GoldPlatinum I player can pick before a PlatDiamond IV player, and a duo between a SilverGold II player and a Bronze III player will always* make the SilverGold II first pick and the Bronze III last pick.
It is in fact very common for players in lower divisions to have higher MMR and thus pick before players in higher divisions. This is most notable in each tier's Division I, as those players tend to have MMR similar to or above that of players in the next higher tier. It is also fairly common to see players in the upper divisions of a tier pick above players in a tier's Division V, as some players in a Division V may be stuck there due to the inability to drop tiers.
Note that in Premade, the pick order is still determined by individual Premade MMR and not the MMR of the team.
*assuming that there are enough people in queue. If for some reason there are few summoners in queue, such as on low-activity servers, then it is very possible for this to not be the case.
For non-ranked Draft Pick games, pick order is not dependent at all upon individual normal MMR. Rather, each player has an equal chance to be first-pick, with captains of premade groups absorbing the chances of their group members. All picks but the first are randomised.