After the American Civil War, the US had a rather sizable number of Civil War Generals serve as President. After WWII, we had only one WWII general get elected president (though a few junior officers got elected). Why the difference?

by xaxers
Georgy_K_Zhukov

Only a single career military officer, US Grant, was elected President in the wake of the Civil War (Edit: I would add for the nitpickers though, that Grant had washed out of the army for a time, but nevertheless, he was an experienced military officer, which is my point). Rutherford B. Hayes, James A. Garfield, and Benjamin Harrison were all lawyers prior to the war, and gained their commissions during the war, which was a very common practice at the time. Essentially, there were two, separate services, in a sense. The Regular Army, and the vastly larger, augmented force made up of units raised by the states (it has no proper name, often refereed to as the Volunteer army, but in WWI the comparable force was known as the National Army, and WWII had the Army of the United States). And those men were all part of the latter. They had no prior military experience, and gained their position based on their stature in the community. Often a wealthy individual would sponsor a unit of volunteers and be made is Colonel for having done so. Anyways though, the point is, that this was just kind of what important people got to do when they joined up in the Civil War. You immediately got to be an officer of Volunteers, and not simply a 2nd Lt. You might be a major, or a captain, or a colonel.

Now we jump forward 80 years. As I noted, there was the Regular Army and the Army of the United States, but the situation simply wasn't the same. You couldn't join up and immediately be put in command of a division. The system of state volunteers that allowed that to happen had been gone since the early 1900s, when the entire militia system was overhauled and replaced with the modern National Guard, which now was an important source of officers to man the expanded military apparatus. And even then of course, jumping from low in the ranks to a star or two was not the hop-skip-and-jump it was in the 1860s. So while every president between Ike and GHW Bush wore a uniform during WWII, only one of them was a career military officer - Eisenhower - who was in the service long enough to have any realistic chance at attaining general rank.

So while this is a bit hypothetical perhaps, had they joined up in 1861 - or had WWII been fought with a system like the Civil War - at least Kennedy, being from a wealthy and well placed family, if not several others, could very likely have found himself joining immediately as a Captain or Major of volunteers in the Union Army, and promotion beyond that could have been easily gained. So the point is that this speaks to the way officers were appointed in the respective periods more than anything. In the wake of both conflicts, the majority of presidents were veterans of the conflict, and the differences in rank are reflective of how ranks worked, with only one President from each conflict actually being a career military officer who gained generalship in the Regular Army.

TL;DR: The nature of military service in the 1860s allowed non-professionals to easily gain high rank in volunteer units, which was no longer a thing in WWII, where gaining high rank much dependent on military experience.