From the Document: "Military law comprises federal law, constitutional authority, and inherent command authority. It is meant to promote justice, efficiency, and discipline in the armed services. Jurisdiction under military law is based on the U.S. Constitution and relevant aspects of international law. Military law jurisdiction is exercised through four distinct forums: (1) courts-martial, (2) courts of inquiry, (3) military commissions, and (4) nonjudicial punishment proceedings [...]. Throughout the 1940s, Congress received evidence of military justice maladministration. The primary concerns were the system's lack of due process and independence. Congress responded to these concerns by enacting the Uniform Code of Military Justice (UCMJ) in 1950, which applies to each armed service and replaced the prior military justice system. The punitive articles in the UCMJ are military law offenses [...]. Many of the punitive articles are criminal conduct offenses that have a referent offense in modern penal codes or historical common law (e.g., rape, murder, robbery). Other punitive articles are military misconduct offenses that have a referent offense in medieval chivalric codes or Roman military practices (e.g., mutiny, desertion, cowardice)."
CRS Insight, IN11787
Congressional Research Service: https://crsreports.congress.gov/