Interesting, I haven't noticed this happen. It's probably proximity based then.
Usually the character you are controlling would be closest just because they're "in front", but if you're separated or an NPC approaches from the side/rear that would cause them to be closer.
Makes sense though and I like it too. I've heard several people talk about wanted a defacto "leader", especially in the co-op conversation discussions, but quite frankly I think that's the single best advancement they've made in turn-based multiplayer RPGs.
The old "one leader, the rest follow" design made multiplayer freaking terrible. Only one player really got to "play the game" while everybody else just watched and waited for combat to control their guy. Boring. While there are still some rough edges to the implementation, I think the freedom/individualism of each character is absolutely the most important and genre-changing feature of OS.