Is it just a lottery?
(waves hand in general direction) "Hey, you there, you're the squad leader."
"Um... sure, whatever."
Are they specially-trained for leadership duty? If so, what happens if the leaders are killed in action? Is there a lower rank that just steps up and takes over, and if so, where does he get HIS leadership training from?
This could apply to Battle Droids too I suppose, but they weren't exactly a raving success thanks to command structure failings. So what makes an soldier in an army of the same guy over and over different than another so that they receive rank and alternate duties?