That's because the U.S. had almost no standing army from the ratification of the U.S. Constitution up until the Civil War. Under the Constitution, a declaration of war by Congress was the legal mechanism for the federal government to have state militia units serve under the command of the President.
Once the state militia units were eliminated after the Civil War, nothing really stops an imperial/totalitarian president from doing whatever the hell he wants with the active-duty military personnel.
That is a grim, pessimistic, and mistaken a view of the matter.