Trench warfare
Precursors: Field works have existed for as long as there have been armies. Roman legions, when in the presence of an enemy, entrenched camps nightly when on the move. The Roman general Belisarius had his soldiers dig a trench as part of the Battle of Dara in 530 AD.
Trench warfare was also documented during the defence of Medina in a siege known as the Battle of the Trench (627 AD). The architect of the plan was Salman the Persian who suggested digging a trench to defend Medina.
There are examples of trench digging as a defensive measure during the Middle Ages in Europe, such as during the Piedmontese Civil War, where it was documented that on the morning of May 12, 1640, the French soldiers, having already captured the left bank of the Po river and gaining control of the bridge connecting the two banks of the river, and wanting to advance to the Capuchin Monastery of the Monte, deciding that their position wasn't secure enough for their liking, then choose to advance on a double attack on the trenches, but were twice repelled. Eventually, on the third attempt, the French broke through and the defenders were forced to flee with the civilian population, seeking the sanctuary of the local Catholic church, the Santa Maria al Monte dei Cappuccini, in Turin, also known at that time as the Capuchin Monastery of the Monte.
In early modern warfare, troops used field works to block possible lines of advance. Examples include the Lines of Stollhofen, built at the start of the War of the Spanish Succession of 1702–1714, the Lines of Weissenburg built under the orders of the Duke of Villars in 1706, the Lines of Ne Plus Ultra during the winter of 1710–1711, and the Lines of Torres Vedras in 1809 and 1810.

In the New Zealand Wars (1845–1872), the Māori developed elaborate trench and bunker systems as part of fortified areas known as pā, employing them successfully as early as the 1840s to withstand British artillery bombardments. According to one British observer, "the fence round the pa is covered between every paling with loose bunches of flax, against which the bullets fall and drop; in the night they repair every hole made by the guns". These systems included firing trenches, communication trenches, tunnels, and anti-artillery bunkers. The Ngāpuhi pā Ruapekapeka is often considered to be the most sophisticated and technologically impressive by historians. British casualties, such as at Gate Pa in 1864 and the Battle of Ohaeawai in 1845, suggested that contemporary weaponry, such as muskets and cannon, proved insufficient to dislodge defenders from a trench system. There has been an academic debate surrounding this since the 1980s, when in his book The New Zealand Wars, historian James Belich claimed that Northern Māori had effectively invented trench warfare during the first stages of the New Zealand Wars. However, this has been criticised by a few academics of the same period, with Gavin McLean noting that while the Māori had certainly adapted pa to suit contemporary weaponry, many historians have dismissed Belich's claim as "baseless... revisionism". Others more recently have said that while it is clear the Māori did not invent trench warfare first—Māori did invent trench-based defences without any offshore aid— some believe they may have influenced 20th-century methods of trench design identified with it.
The Crimean War (1853–1856) saw "massive trench works and trench warfare", even though "the modernity of the trench war was not immediately apparent to the contemporaries".
Union and Confederate armies employed field works and extensive trench systems in the American Civil War (1861–1865) — most notably in the sieges of Vicksburg (1863) and Petersburg (1864–1865), the latter of which saw the first use by the Union Army of the rapid-fire Gatling gun, the important precursor to modern-day machine guns. Trenches were also utilized in the Paraguayan War (which started in 1864), the Second Anglo-Boer War (1899–1902), and the Russo-Japanese War (1904–1905).

Adoption: Although technology had dramatically changed the nature of warfare by 1914, the armies of the major combatants had not fully absorbed the implications. Fundamentally, as the range and rate of fire of rifled small-arms increased, a defender shielded from enemy fire (in a trench, at a house window, behind a large rock, or behind other cover) was often able to kill several approaching foes before they closed around the defender's position. Attacks across open ground became even more dangerous after the introduction of rapid-firing artillery, exemplified by the "French 75", and high explosive fragmentation rounds. The increases in firepower had outstripped the ability of infantry (or even cavalry) to cover the ground between firing lines, and the ability of armour to withstand fire. It would take a revolution in mobility to change that.
The French and German armies adopted different tactical doctrines: the French relied on the attack with speed and surprise, and the Germans relied on firepower, investing heavily in howitzers and machine guns. The British lacked an official tactical doctrine, with an officer corps that rejected theory in favour of pragmatism.
While the armies expected to use entrenchments and cover, they did not allow for the effect of defences in depth. They required a deliberate approach to seizing positions from which fire support could be given for the next phase of the attack, rather than a rapid move to break the enemy's line. It was assumed that artillery could still destroy entrenched troops, or at least suppress them sufficiently for friendly infantry and cavalry to manoeuvre.

Digging-in when defending a position was a standard practice by the start of WWI. To attack frontally was to court crippling losses, so an outflanking operation was the preferred method of attack against an entrenched enemy. After the Battle of the Aisne in September 1914, an extended series of attempted flanking moves, and matching extensions to the fortified defensive lines, developed into the "race to the sea", by the end of which German and Allied armies had produced a matched pair of trench lines from the Swiss border in the south to the North Sea coast of Belgium.
By the end of October 1914, the whole front in Belgium and France had solidified into lines of trenches, which lasted until the last weeks of the war. Mass infantry assaults were futile in the face of artillery fire, as well as rapid rifle and machine-gun fire. Both sides concentrated on breaking up enemy attacks and on protecting their own troops by digging deep into the ground. After the buildup of forces in 1915, the Western Front became a stalemated struggle between equals, to be decided by attrition. Frontal assaults, and their associated casualties, became inevitable because the continuous trench lines had no open flanks. Casualties of the defenders matched those of the attackers, as vast reserves were expended in costly counter-attacks or exposed to the attacker's massed artillery. There were periods in which rigid trench warfare broke down, such as during the Battle of the Somme, but the lines never moved very far. The war would be won by the side that was able to commit the last reserves to the Western Front. Trench warfare prevailed on the Western Front until the Germans launched their Spring Offensive on 21 March 1918. Trench warfare also took place on other fronts, including in Italy and at Gallipoli.
Armies were also limited by logistics. The heavy use of artillery meant that ammunition expenditure was far higher in WWI than in any previous conflict. Horses and carts were insufficient for transporting large quantities over long distances, so armies had trouble moving far from railheads. This greatly slowed advances, making it impossible for either side to achieve a breakthrough that would change the war. This situation would only be altered in WWII with greater use of motorized vehicles.

Construction: Trenches were longer, deeper, and better defended by steel, concrete, and barbed wire than ever before. They were far stronger and more effective than chains of forts, for they formed a continuous network, sometimes with four or five parallel lines linked by interfacings. They were dug far below the surface of the earth out of reach of the heaviest artillery....Grand battles with the old maneuvers were out of the question. Only by bombardment, sapping, and assault could the enemy be shaken, and such operations had to be conducted on an immense scale to produce appreciable results. Indeed, it is questionable whether the German lines in France could ever have been broken if the Germans had not wasted their resources in unsuccessful assaults, and the blockade by sea had not gradually cut off their supplies. In such warfare no single general could strike a blow that would make him immortal; the "glory of fighting" sank down into the dirt and mire of trenches and dugouts.

Early World War I trenches were simple. They lacked traverses, and according to pre-war doctrine were to be packed with men fighting shoulder to shoulder. This doctrine led to heavy casualties from artillery fire. This vulnerability, and the length of the front to be defended, soon led to frontline trenches being held by fewer men. The defenders augmented the trenches themselves with barbed wire strung in front to impede movement; wiring parties went out every night to repair and improve these forward defences.