Staff (military)
Military staff functions: 

Information management: One of the key purposes of a military staff is to provide accurate, timely information (which includes the results of contingency planning) on which command decisions are based. A goal is being able to suggest approaches or help produce well-informed decisions that will effectively manage and conserve unit resources.
In addition to generating information, the staff also manages the flow of communication within the unit and around it. While controlled information flow toward the commander is a priority, those useful or contingent in nature are communicated to lower-level units and/or through their respective staffs. If the information is not pertinent to the unit, it is redirected to the command level which can best utilize the condition or information.
Staffs are generally the first to know of issues that affect its group. Issues that require major decisions affecting the unit's operational capability are communicated to the commanding officer. However, not all issues will be handled by the commander. Smaller matters that arise are given to a more appropriate tasker within the unit to be handled and resolved, which would otherwise be an unnecessary distraction for the Commanding Officer who already makes numerous decisions every day.
In addition, a staff aims to carefully craft any useful situations and utilize that information.

Staff structure: In a generic command staff, more seasoned and senior officers oversee staff sections of groups organized by the needs of the unit. Senior Enlisted Personnel task personnel in the maintenance of tactical equipment and vehicles. Senior Analysts are tasked with the finalizing of reports, and their enlisted personnel participate in the acquisition of information from subordinate staffs and units. This hierarchy places decision making and reporting under the auspices of the most experienced personnel and maximizes information flow of pertinent information sent out of the command overall, clarifying matters overall. This frees up the most senior members of the command at each level for decision making and issuing direction for further research or information gathering (perhaps requiring men to put their lives at risk to gather additional intelligence).
Operations staff officers also are tasked with battle planning both for offensive and defensive conditions, and issuing contingency plans for handling situations anticipated during the foreseeable future.

History: Prior to the late 18th century, there was generally no organizational support for staff functions such as military intelligence, logistics, planning or personnel. Unit commanders handled such functions for their units, with informal help from subordinates who were usually not trained for or assigned to a specific task.

Austria: Count Leopold Joseph von Daun, in a letter to Empress Maria Theresa in January 1758, pressed for a more important role for the Generalquartiermeister (Chief of Staff). The failures in the army, especially at the Battle of Leuthen made it clear that Austria had no "great brain" and the command needed to spread the workload to allow the Commander-in-chief the time to consider the strategic picture. The 1757 regulations had created the Grosse Feldgeneralstab and Kleine Generalstab (large and small general staff) and after changes in 1769, a permanent staff of 30 officers was established under the direction of Franz Moritz von Lacy, which would be expanded in wartime with junior officers. The Grosse staff was divided into three: First, the Intrinsecum, which handled internal administration and directing operations; secondly, external activities, including the Pioneers; thirdly, the Inspection Service, which handled the issuing of orders and prisoners of war. Alongside the General Staff was the General Adjutant, who led a group of Adjutant staff selected by the army commanders to handle the details of internal administration and collating intelligence, and answered to the Commander-in-chief. The Chief of Staff became the chief adviser to the Commander-in-chief and, in a fundamental move away from the previous administrative role, the Chief of Staff now undertook operational planning, while delegating the routine work to his senior staff officers. Staff officers were drawn from line units and would later return to them, the intention being that they would prove themselves as leaders during their time with the staff. In a battle or when the army had detached corps, a small number of staff would be allocated to the column commander as a smaller version of headquarters. The senior man, usually a Major, would be the chief of the column staff and his principal task would be to help the commander to understand what was intended.
When Karl Mack von Leiberich became chief of staff of the army under Prince Josias of Saxe-Coburg-Saalfeld in the Netherlands, he issued the Instruktionspunkte für gesammte Herren Generals, the last of 19 points setting out the roles of staff officers, dealing with offensive and defensive operations, while helping the Commander-in-chief. In 1796, Archduke Charles, Duke of Teschen augmented these with his own Observationspunkte, writing of  the Chief of Staff: "he is duty bound to consider all possibilities related to operations and not view himself as merely carrying out those instructions".
On 20 March 1801, Feldmarschalleutnant Duka became the world's first peacetime Generalquartiermeister at the head of the staff and the wartime role of the Chief of Staff was now focused on planning and operations to assist the Commander. Archduke Charles, Duke of Teschen himself produced a new Dienstvorschrift on 1 September 1805, which divided the staff into three: 1) Political Correspondence; 2) the Operations Directorate, dealing with planning and intelligence; 3) the Service Directorate, dealing with administration, supply and military justice. The Archduke set out the position of a modern Chief of Staff: "The Chief of Staff stands at the side of the Commander-in-Chief and is completely at his disposal. His sphere of work connects him with no specific unit". "The Commander-in-Chief decides what should happen and how; his chief assistant works out these decisions, so that each subordinate understands his allotted task". With the creation of the Korps in 1809, each had a staff, whose chief was responsible for directing operations and executing the overall headquarters plan. The staff on the outbreak of war in 1809 numbered over 170. Finally in 1811, Joseph Radetzky von Radetz produced his Über die bessere Einrichtung des Generalstabs, which prioritised the Chief of Staff's managerial and supervisory role with the departments (Political Correspondence, Operations and Service) under their own directors, effectively merging the Adjutants and General Staff officers. In this system lay the beginnings of a formal staff corps, whose members could specialise in operations, intelligence and logistics.

France: Despite a short lived permanent staff under St-Cyr (1783–90), the French reverted to the old system in 1790, when the Revolutionary Government abolished the staff corps. When General Louis Alexandre Berthier was appointed Chief of Staff to the French Army of Italy in 1795, his was the old administrative role, accurately described by Jomini and Vachee as "the chief clerk" and "of limited competence". His manual is merely a reporting system as a kind of office manual. Staff officers were rotated out of the line on the Austrian model, but received no training and merely became efficient in the administrative tasks, especially the rapid issuance of orders.  It suited Napoleon Bonaparte from the moment he took over the army the following year and he would use Berthier's system throughout his wars. Crucially, Napoleon remained his own intelligence chief and operational planner, a workload which, ultimately, not even he could cope with.

Myanmar: Overall staff system structure is generally similar to the pre 1984 British Army system with G Branch, A Branch and Q Branch with slightly different staff officer position names. Unlike the continental system, 1 is higher ranking than 2 followed by 3. Despite being called GSO, ASO and QSO in English, all of them are translated as either စစ်ဦးစီးမှူး for G (or) ဦးစီးအရာရှိ for A and Q in Burmese. You can check the 2010/2011 military command structure of Myanmar in the photo shown below which still uses the same staff system

G Branch (စစ်ဦးစီး): G Branch, called စစ်ဦးစီး or ဦး for short in Burmese, is responsible for Responsible for intelligence, training and every aspect of operations.
General Staff Officer (Grade 1), informally known as G1: Ranked Lieutenant Colonel or a Colonel
General Staff Officer (Grade 2), informally known as G2: Ranked Major
General Staff Officer (Grade 3), informally known as G3: Ranked Captain

A Branch (စစ်ရေး): A Branch, called စစ်ရေး or ရေး for short in Burmese, is responsible for every aspect of personnel management such as medical and military.