First, it's by position. If you only have one player designated with a primary position of 2B, that is your 2B in all line-ups. After that, it seems to be some combination of splits/handedness(batting). I don't know if I've ever seen a better defender get the start over a superior offensive player with the same primary position.