So, General Staffs. Being a General is hard. Armies are big and hungry and very rarely happy. Over time, armies have gotten bigger and require more provisions better campaign organization. Add onto that the changing tactical and operational situations through time. Armies require better orders on the field of battle since giving orders is much more possible in 1800 than in 1100, and proper coordination is the second most important part of wining modern (by which I mean starting in about 1500) battles, right after troop discipline.
Armies before 1805 were commanded always by individuals. Unfortunately, unlike the medieval period, only a genius could command to an effective level alone, and yet genius was expected. Men like Fredrick the Great or Napoleon were geniuses. Quartermasters, men who organized logistics were always present, and Fredrick the Great wrote that the only person a General should share his plans with is his quartermaster. However, even without worrying about logistics, Generals had a huge amount of work to do that only an overachieving genius could accomplish. As such, men like Napoleon and Gustavus Adolphus stood astride other commanders like colossi, and defeated most of Europe in their respective days.
Napoleon is really the man who germinated the idea of the general staff, and of modern military command in general, even though he didn't need one. See, the Prussians after Fredrick the Great were considered the best soldiers in the world. They had some right to boast, but at a place called Jena, they were utterly obliterated by Napoleon, and right afterward the French Emperor waltz through Berlin the undisputed master of military matters at the time. See, the Prussians were not commanded well, they did not fight creatively or in the new fashions that Napoleon proved so incredibly effective. The details of Napoleonic combat could fill a book, and frequently do, and thus will not be detailed here. All that one needs to know is that in 1805 the King realized that something needed to be done.
Prussia may not have had any great genius to oppose Napoleon, but they did have some truly great military thinkers. Scharnhorst and Gneisenau were the two main architects, with some other less important individuals and a young man named Carl von Clausewitz, whose importance is hard to overstate in the years following this. Anyways: these great military thinkers gathered and had the king's blessing to make a new system of command, and to revitalize the armies of Prussia. And this they did.
The first general staff, the result of this conclave, was something rather simple, but innovative. If one man could not lead an army, why not get a bunch of them? Also, since armies around the world, including in Prussia were led by nobility, why not attach a career solider to this leader? These nobles were not lazy or fools, usually, and they took their study of military matters seriously, but their ability rarely could compare to someone who had been educated in military theory their whole life, and had served in real actions.
So, in 1814, the general staff was made law by the King. There would be an attached staff officer to each commander at every strategic level, and this staff officer had the right and expectation to protest bad orders and suggest good ones. Leaders were expected to listen, since as a nuclear option staff officers could protest to their commander’s commander’s staff officer. This could go all the way up to the King and the Chief of General Staff. General Staff officers thus assumed much of the leadership of armies, and had not only capable officers above and below them, but they had their own groups that would help them plan every detail of newly-complex operations.
Soldiers trained to enter the staff were not only the best of the best, but since they were all trained from the same orthodoxy, most looked at situations the same way, or could assume what their fellows would think about situations, radically boosting cooperation in an age without radio. The general staff system created new, well-trained geniuses and provided them a support network and independence, while still maintaining traditional positions for nobility. The system worked like an absolute dream, and in 1815 August von Gneisenau and Gerhard von Blucher kicked Napoleon off the continent once and for all.
Strangely enough, very few emulated the Germans. The British did to a small extent, but it was not until the Wars of German Unification that people started emulating. When the elder von Moltke and his staff obliterated the Austrians, the Austrians learned their lessons. But the Austrians were small fry. The real shock came when the North German Confederation absolutely humiliated the French, who were superior in many areas of technology and were though the best soldiers in the world, and defeated them utterly within two weeks of war being declared. Then the French and British learned their lessons.
General staffs changed over time. The German version was the first, but France and Britain both had their own takes on the matter, both versions more centralized but not headed absolutely by a supreme commander like Germany. The merits of these systems would be tested in World War 1, when each would change, and once again Germany would set the standard for dynamic modern leadership with its Third General Staff.