When a battlefield starts and teams are created, all players that signed up and entered are ordered by their highest obtained Hero Rating and then assigned to either red or blue team.
1 Player 4000 > Red team
2 Player 3900 > Blue team
3 Player 3500 > Red team
4 Player 3400 > Blue team
5 Player 3300 > Red team
6 Player 3200 > Blue team
etc. etc.
Red team is not necessarily first pick, that is random too, could be blue team first sometimes. So red team will not always get the highest rated player.
Hero Rating itself is calculated on the quality of your equipped items, the quality of the cards, how much they are enhanced and if they are using the special (coloured) enhancements, your wearing card quality, title quality, mantle quality, skill point total, guild skill total etc. etc.
Currently the formulas used to calculate the quality of items such as armor, weapons and accessories is by level and rarity type, which means a level 100 Epic Wonderland helm will have the same score as a level 100 Epic Dead Man's Peak helm, so it's not too fine grained at the moment but I have been working on a gear scoring system that when used will make it much more accurate.
The battlefield team system is not perfect, you can still get several healers on one team, or several of the same class, or somebody with great gear that can't play their class, but I believe it's better than before where it was completely random and you could end up with all the strong players on one side.