The Royal Navy
The Articles of War for the Royal Navy were first formalised in an Act of Parliament passed in 1661, soon after the restoration of Charles II (although based on an earlier document from the Commonwealth period, and ultimately on the ancient sea laws of Oleron which were incorporated in the medieval Black Book of Admiralty). Charles' act was replaced by an act formulated by George Anson in 1749 during the reign of George II, after politicians, the House of Commons, and the common law courts had interfered with the Courts-martial resulting from the poor performance of the Royal Navy in the battle of Toulon in February 1744, during the War of Austrian Succession. The 1749 act established the powers and independence of naval Courts-martial, but gave them little latitude to vary or avoid the (severe) penalties prescribed in the Articles of War. The inflexibility of this act led to the execution of Vice-Admiral John Byng in 1757, and only 22 years later was an amendment introduced which allowed Courts-martial some measure of discretion. Nonetheless the specified punishments were still draconian, and were starting to become unacceptable by the time of the Napoleonic Wars, and were in practice quite ignored by the middle of the 19th century. In August 1860 Lord Clarence Paget, the First Secretary of the Admiralty, and the government's spokesman on naval affairs, introduced a new bill that brought theory back into line with practice (at least as implemented by the more enlightened commanding officers of the time). In the 1860s a number of revisions were made, but the 1866 Naval Discipline Act was to remain in force for nearly 100 years, being replaced by the 1957 Naval Discipline Act. This act, like all its predecessors, but unlike the other Service Discipline Acts (the Army and Air Force Acts), was originally a permanent act. In 1971, however, a five-yearly Armed Forces Act became necessary to prolong its validity - a mechanism allowing Parliament to periodically review and modify the Service Discipline Acts; for example, the 1971 act modified sections 2 to 5 (Misconduct in action and assistance to enemy) of the 1957 act. In 2006 the Armed Forces Act finally replaced all the Service Discipline Acts, giving uniform disciplinary procedures within all branches of the British armed forces. The description of offences in the 2006 act no longer bears the heading "Articles of War".
The Royal Marines
The Bill of Rights (1 Will. & Mar. sess. 2 cap. 2), which became law upon the affirmation of William and Mary as joint successors to James II in 1688, made parliamentary approval a requirement for a standing army in times of peace. To enforce this provision, and to sanction disciplinary procedures in the army (and the Royal Marines, when on shore, and thus not subject to the Naval Discipline Act), parliament passed yearly Mutiny and Naval Mutiny Acts.