It's not like armies had loads of Major Generals lying around in case they had a war, did they rapidly promote existing officers or have a selection process? This question could apply to non commissioned officers as well
During WWII, most, if not all, of the commanders of the new infantry and armored divisions (on paper, major generals, but brigadier generals did serve as acting division commanders often) were career officers that had begun their military experience fighting on the ground as enlisted men or low-grade officers in World War I, or had commanded outfits stateside. Most were over 50 years old. Immediately before the war, many had risen to command battalions and regiments, or were even assistant division commanders. In general, division commanders were promoted or selected from existing high-grade officer ranks, and many did advance quite quickly, two or three ranks in the span of two years. By virtue of command experience and length of service, they would not be overwhelmed by this. Only the best officers were selected to command divisions.
When a new division was to be activated, the general officers (division commander, assistant division commander, artillery commander) were selected by Army Ground Forces Headquarters. The G-1 (manpower and personnel) section of the Army Ground Forces compiled a list of officers (not necessarily general officers yet) by efficiency rating that were already in the active Army and were eligible for promotions or transfers to such a position. This list was given to Lieutenant General Lesley McNair, head of the Army Ground Forces, who looked over it and made his nominations for division commanders to the War Department. The G-1 section picked the other positions off the list, subject to McNair's approval. The G-1 section also controlled the flow of division officers into their respective training schools, and then to the division's camp.
The G-3 (operations) section of the Army Ground Forces was responsible for facilitating and providing the general manpower strength to the new division, designating a camp for the division to train at, and informing all relevant agencies that needed to provide personnel and equipment for a new division that one was being activated.
Lower-grade officers like lieutenants were selected through training at Officer Candidate Schools and graduation from college ROTC programs. Before a division was to be activated, the officers underwent training relevant to their specific branches in order to best train the men they would command in their new division when it was activated. Noncommissioned officers generally advanced through promotion and training outcomes; all rifle squad leaders were "bumped up" from Sergeant to Staff Sergeant in mid-1943. Transfers during the training period and, later in the war, "stripping" of divisions that were stateside for want of replacements to send overseas diminished the cohesion of the divisions, who were supposed to stay together from day one of training until their first combat.
Source:
United States Army in World War II (The Army Ground Forces); The Procurement and Training of Ground Combat Troops, by Robert R. Palmer, Bell I. Wiley, and William R. Keast (Historical Section, Army Ground Forces)
John Bourne has a good lecture [here] (https://www.youtube.com/watch?v=qSOHzMjobvs) about 'hiring and firing' in the British Expeditionary Force in WWI. I'd also recommend that you read his essay on Australian and British general officers in WWI in this collection [here] (http://www.army.gov.au/~/media/Files/Our%20history/AAHU/Conference%20Papers%20and%20Images/1998/1998%201918%20Defining%20Victory.pdf).
EDIT:
The bulk of the General Officers in the British and Commonwealth forces in WWI had served in their countries professional army prior to the war, either Regular Army in Britain or militia forces in Canada, Australia, etc. It appears that in the case of the British Army, the War Office kept a roster of senior officers who might be eligible to command forces in the future, and there were also officers who acted as 'talent scouts,' essentially, to add new names to the list if need be.