Sort:  

The first tag is the main tag. I am unsure how the algorithm works but my guess is that it has something to do with the number of posts containing the tag. The main tag plays a major part in that (but that is just my assumption).