This section is from the book "Constitutional Law In The United States", by Emlin McClain. Also available from Amazon: Constitutional Law in the United States.
The express power given to Congress "To make rules for the government and regulation of the land and naval forces" (Const. Art. I, § 8, ¶ 14) has been exercised by the adoption of a code of military law for the government of the officers and men composing the land and naval forces. This code is in force in time of peace as well as during war, but it applies exclusively to the persons who constitute the land and naval forces, that is, the soldiers and sailors, including in those terms both officers and men. By this military law their conduct is regulated and punishments for its violation are provided. Offenders against the military law are triable before a court-martial composed of officers of the army or navy, as the case may be, under the direction of a judge advocate; and the punishment of the offender found guilty is administered under military or naval authority. The different forms of punishment provided for include death, imprisonment, fine, degradation in rank, dismissal from the service, reprimand, and other penalties.
It is to be noticed that a court-martial has jurisdiction only over persons who are enrolled in the military or naval forces, and administers only the military law. When a state of war exists and the operation of the ordinary courts within any portion of territory which is subjected to military occupation is thereby suspended, the military power may provide temporarily for military courts or commissions administering law for the time being among persons within such territory who are not part of the military forces, but these military courts or commissions are not courts-martial and they can exercise jurisdiction within the limits of the United States only where the ordinary operations of the courts have been suspended by declaration of martial law. While declaration of martial law is not expressly provided for in the constitution, it is regarded as authorized by the provision for the suspension of the privilege of habeas corpus (Const. Art. I, § 9, ¶ 2).
 
Continue to: