Ranking System
In both factions of the game, there's a ranking system, which places the members who are part of it in a definite hierarchy, where those higher up on it are allowed to give orders and command those lower on it. There's a bit more leeway for members of the Keyblade Order than it is for those working with Maleficent and Xehanort.
Keyblade Order:
The Head of the Order is the highest ranked member of the Keyblade Order, and it is him that ultimately decides all of the orders that or given. Or at the very least, he is allowed to override the orders that other masters give if he does not think that those orders are for the best. This position had been previously held by Master Eraqus before his death, and is currently held by Yen Sid.
The Second in Command is the Keyblade Master that is second in command of everyone in the order. He has the highest authority of anyone in the Order, and is only answerable to the Head of the order himself. King Mickey is the current holder of this position, although Yen Sid is hoping that Mickey will be willing to take over as the Head of the Order soon enough.
Keyblade Masters are those who have passed the Mark of Mastery Exam and have proven themselves to be capable in knowledge of the Keyblade and combat beyond that which Keyblade Wielders have. It is at this rank when people usually start teaching the Students and Keyblade Wielders their knowledge of the keyblade. A Master usually accompanies Keyblade Wielders and Students on the larger, more dangerous missions where coordination is key.
Keyblade Wielders are those who have gone through a decent amount of their training, showing that they have enough competency with the keyblade and magic to be trusted to go on missions on their own. While usually a Keyblade Wielder would go on a mission alone, occasionally a single Wielder might be put in charge of students or other wielders on a mission. Those instances become even greater the closer the lead wielder is to becoming a master him/herself. This is one of the two ranks that members can initially join the order as, depending on their previous experience with swords, magic, and fighting.
Students are just that, those new to using the powers of the keyblade and fighting in general. Unlike Keyblade Wielders, students never go on missions alone, and spend most of their time in lessons with masters rather than constantly going on missions. A subrank of the Student rank is the Apprentice, which when a master takes on a student for training one on one (or in some cases one-on-two or three). However, with the large amount of keyblade wielders being found recently, a master actually taking on an apprentice has become a lot rarer, as all the Masters are having to train newer students.
The ranks for the Villains is a bit less formal.
For starters, Xehanort and Maleficent are the leaders of the Villain faction, with Pete serving a high ranking henchmen of some sorts.
Other than those three, there are two more positions.
Generals are just that, those that Xehanort and Maleficent feel would be decent or useful as commanders of their little army. Generals have been granted the power to control the Heartless by both Maleficent and Xehanort, and are able to command large amounts of heartless. Officially, they are also supposed to be in command of the lower ranked henchmen, but how often do villains really play fair and follow expectations like that, especially when they don't even bother to name their organization.
Henchman is the rank given to everyone that isn't given the rank of General. As the standard rank, a Henchman doesn't really have much in the way of power or influence at all. However, they do possess minor control over the Heartless, but can really only manage to hold control over a few of them at a time, all of which can only be of low rank like Shadows, Soldiers, and maybe the Red/Blue/Yellow/Green Nocturne/Rhapsody/Opera/Requiems.