Desertion
"During the period between August 1914 and March 1920 more than 20,000 servicemen were convicted by courts-martial of offences which carried the death sentence. Only 3,000 of those men were ordered to be put to death and of those just over 10% were executed."

Second World War: Throughout the Second World War, almost 100,000 British and Commonwealth troops deserted from the armed forces. Capital punishment for desertion was abolished in 1930 so most were imprisoned.

Iraq War: On 28 May 2006, the UK military reported over 1,000 absent without leave since the beginning of the Iraq War, with 566 missing from 2005 and that part of 2006. The Ministry of Defence said that levels of absence were fairly constant and "only one person has been found guilty of deserting the Army since 1989".

United States: 

Legal definition: According to the United States Uniform Code of Military Justice, desertion is defined as: 

(a) Any member of the armed forces who–
(1) without authority goes or remains absent from his unit, organization, or place of duty with intent to remain away therefrom permanently;
(2) quits his unit, organization, or place of duty with intent to avoid hazardous duty or to shirk important service; or
(3) without being regularly separated from one of the armed forces enlists or accepts an appointment in the same or another one of the armed forces without fully disclosing the fact that he has not been regularly separated, or enters any foreign armed service except when authorized by the United States; is guilty of desertion.
(b) Any commissioned officer of the armed forces who, after tender of his resignation and before notice of its acceptance, quits his post or proper duties without leave and with intent to remain away therefrom permanently is guilty of desertion.

(c) Any person found guilty of desertion or attempt to desert shall be punished, if the offense is committed in time of war, by death or such other punishment as a court-martial may direct, but if the desertion or attempt to desert occurs at any other time, by such punishment, other than death, as a court-martial may direct.

War of 1812: The desertion rate for American soldiers in the War of 1812 was 12.7%, according to available service records. Desertion was especially common in 1814, when enlistment bonuses were increased from $16 to $124, inducing many men to desert one unit and enlist in another to get two bonuses.

Mexican–American War: During the Mexican–American War, the desertion rate in the U.S. Army was 8.3% (9,200 out of 111,000), compared to 12.7% during the War of 1812 and usual peacetime rates of about 14.8% per year. Many men deserted in order to join another U.S. unit and get a second enlistment bonus. Others deserted because of the miserable conditions in camp, or in 1849–1850 were using the army to get free transportation to California, where they deserted to join the California Gold Rush. Several hundred deserters went over to the Mexican side; nearly all were recent immigrants from Europe with weak ties to the United States. The most famous group was the Saint Patrick's Battalion, about half of whom were Catholics from Ireland, anti-Catholic prejudice reportedly being another reason for desertion. The Mexicans issued broadsides and leaflets enticing U.S. soldiers with promises of money, land grants, and officers' commissions. Mexican guerrillas shadowed the U.S. Army, and captured men who took unauthorized leave or fell out of the ranks. The guerrillas coerced these men to join the Mexican ranks—threatening to kill them if they failed to comply. The generous promises proved illusory for most deserters, who risked execution if captured by U.S. forces. About fifty of the San Patricios were tried and hanged following their capture at Churubusco in August 1847.
High desertion rates were a major problem for the Mexican army, depleting forces on the eve of battle. Most of the soldiers were peasants who had a loyalty to their village and family but not to the generals who conscripted them. Often hungry and ill, never well paid, under-equipped and only partially trained, the soldiers were held in contempt by their officers and had little reason to fight the Americans. Looking for their opportunity, many slipped away from camp to find their way back to their home village.

American Civil War: During the American Civil War, both the Union and Confederacy had a desertion problem. From its 2.5 million or so men, the Union Army saw about 200,000 desertions. Over 100,000 deserted the Confederate army, which was less than a million men and possibly as little as a third the size of the Union Army.
New York suffered 44,913 desertions by the war's end, and Pennsylvania recorded 24,050, with Ohio reporting desertions at 18,354. About 1 out of 3 deserters returned to their regiments, either voluntarily or after being arrested and being sent back. Many of the desertions were by "professional" bounty men, men who would enlist to collect the often large cash bonuses and then desert at the earliest opportunity to repeat another enlistment elsewhere. If caught they would face execution; otherwise it could prove a very lucrative criminal enterprise.
The total number of Confederate deserters was officially 103,400. Desertion was a major factor for the Confederacy in the last two years of the war. According to Mark A. Weitz, Confederate soldiers fought to defend their families, not a nation. He argues that a hegemonic "planter class" brought Georgia into the war with "little support from non-slaveholders" (p. 12), and the ambivalence of non-slaveholders toward secession, he maintains, was the key to understanding desertion. The privations of the home front and camp life, combined with the terror of battle, undermined the weak attachment of southern soldiers to the Confederacy. For Georgian troops, Sherman's march through their home counties triggered the most desertions.

Adoption of a localist identity caused soldiers to desert as well. When soldiers implemented a local identity, they neglected to think of themselves as Southerners fighting a Southern cause. When they replaced their Southern identity with their previous local identity, they lost their motive to fight and, therefore, deserted the army.
A growing threat to the solidarity of the Confederacy was dissatisfaction in the Appalachian mountain districts caused by lingering unionism and a distrust of the slave power.  Many of their soldiers deserted, returned home, and formed a military force that fought off regular army units trying to punish them.  North Carolina lost 23% of its soldiers (24,122) to desertion. The state provided more soldiers per capita than any other Confederate state, and had more deserters as well.

First World War: Desertion still occurred among American armed forces after the U.S. joined the First World War on 6 April 1917. Between 6 April 1917, and 31 December 1918, the American Expeditionary Forces (AEF) charged 5,584 servicemen and convicted 2,657 for desertion. 24 AEF troops were eventually sentenced to death, but all managed to avoid execution after President Woodrow Wilson commuted their death sentences to prison terms. Deserters were often publicly humiliated. One U.S. Navy deserter, Henry Holscher, later joined a UK regiment and won the Military Medal.

Second World War: Over 20,000 American soldiers were tried and sentenced for desertion. Forty-nine were sentenced to death, though forty-eight of these death sentences were subsequently commuted. Only one U.S. soldier, Private Eddie Slovik, was executed for desertion in World War II.

Vietnam War: According to the Department of Defense, 503,926 United States servicemen deserted during the Vietnam War between 1 July 1966 to 31 December 1973. Some of these migrated to Canada. Among those who deserted to Canada were Andy Barrie, host of Canadian Broadcasting Corporation Radio's Metro Morning, and Jack Todd, sports columnist for the Montreal Gazette. Other countries also gave asylum to deserted U.S. soldiers. For example, Sweden allows asylum for foreign soldiers deserting from war, if the war does not align with the current goals of Swedish foreign policy.

Iraq War: According to the Pentagon, more than 5,500 military personnel deserted in 2003–2004, following the Iraq invasion and occupation. The number had reached about 8,000 by the first quarter of 2006. Almost all of these soldiers deserted within the United States. There has been only one reported case of a desertion in Iraq. The Army, Navy, and Air Force reported 7,978 desertions in 2001, compared with 3,456 in 2005. The Marine Corps showed 1,603 Marines in desertion status in 2001. That had declined to 148 by 2005.

Penalties: Before the Civil War, deserters from the Army were flogged; after 1861, tattoos or branding were also used. The maximum U.S. penalty for desertion in wartime remains death, but this punishment was last applied to Eddie Slovik in 1945. No U.S.