The Basic Structure of Military Earthworks
Military earthworks put in place a barrier between the army and the enemy it is defending its territory against. The basic form of any such military earthwork is a mound of earth or embankment that rises above the general ground level. This embankment is formed from earth that is excavated in the same area forming a ditch. This ditch also adds to the height or depth available for protection.
Foxholes are the simplest forms of military earthworks and are normally dug in position by the soldier who is going to use it for his defense in actual battle. A section of soldiers may connect up their individual foxholes to make a continuous trench that is also used to facilitate the supply of ammunition and communication with commanders.
A more permanent form of earthwork may have facing materials on the parapet that makes up the higher part of the earthen embankment. This could be constructed with stones, sandbags, wood, or any other material. Such additional protection requires additional time and is rarely a form adapted in actual battle conditions. Other forms of military earthworks are moats, which were quite often made around inhabited areas and then filled with water to slow down any enemy onslaught. Modern day warfare uses the same technology in creating tank trenches quite often for miles together to slow down any armored column assault.
Image Source: Wikimedia: Trenches
The Logic behind Military Earthworks
KOCOA is the acronym used to assess the terrain and use it for positioning of troops. K stands for key terrain, O for observation and field of fire, C for cover and concealment, O for obstacles that earthworks can create, and A for avenues that facilitate advance and withdrawal. These same principles were even used in the Civil War. The idea of entrenchments is to use the terrain to provide a clear field of fire while protecting the soldier enabling him to conceal himself and take cover from enemy fire.
Military units can prepare earthworks that are created in advance for use by artillery or infantry. Earthwork for artillery has to take in account platforms for the guns and storage for ammunition and cover needed for soldiers while firing the guns. It has also to take into consideration the need for moving the artillery. Earthwork prepared in advance for use by infantry are purely for defense and would have individual shelter pits and probably would be in the form of continuous trenches with revetment for additional protection. In battle situations similar earthworks can also be made for both artillery and infantry, but would normally be the sort that can be put up immediately. In battle situations officers have also to think of earthworks in the form of trenches that would help in communication and supply. Ordnance personnel would have to organize bunkers to store ammunition that needs to be protected from enemy fire. This they do by placing additional earthwork over the roofed trenches.
Image source: Wikimedia: Earthwork
US National Park Service - Military earthworks
Civil War Fortification Study Group - Civil War fortifications