Flanking maneuver
Tactical flanking: The flanking maneuver is a basic military tactic with several variations. Flanking an enemy entails attacking from one or more sides, at an angle to the enemy's direction of engagement. There are three standard flanking maneuvers.
The first maneuver is the ambush, where a unit performs a surprise attack from a concealed position. Units friendly to the ambushing unit may be hidden to the sides of the ambush site to surround the enemy, but care must be taken in setting up fields of fire to avoid friendly fire. Ambush as a tactic is typically favored by smaller, more mobile forces, usually ones with favorable terrain.  An example of this would be the Battle of Beaver Dams, where the British ambushed the Americans, halting their advance further inland to Canada.
The second type is used during an attack, where a unit encounters an enemy defensive position. Upon receiving fire from the enemy, the unit commander may decide to order a flank attack. A part of the attacking unit pins the enemy in place with suppressive fire, preventing them from returning fire, retreating or changing position to meet the flank attack. The flanking force then advances to the enemy flank and attacks them at close range. Coordination to avoid friendly fire is also important in this situation. This is employed largely by forces meeting each other with equal strength.
The third form of flanking maneuvers is the double envelopment, which involves simultaneous flank attacks on both sides of the enemy. An example is Hannibal's victory over the Roman army at the Battle of Cannae. Double envelopment can only be performed by widening friendly units or formations or opening gaps between them which results in weakening the center and similar battles to that of Gaugamela. Thus, it was often employed when severely outnumbering the opponent or against those without sufficient cavalry support.

Maneuvering: Flanking on land in the pre-modern era was usually achieved with cavalry (and rarely, chariots) due to their speed and maneuverability, while heavily armored infantry was commonly used to pin the enemy in place, as in the Battle of Pharsalus. Armored vehicles such as tanks replaced cavalry as the main force of flanking maneuvers in the 20th century, as seen in the Battle of France in World War II.

Defense: The use of flanking has been a consistent part of warfare since its invention. The responsibility of defending against flanks falls on the commander, who has to make the choice of how to best use terrain. In addition, the proper adjustment and positioning of soldiers is imperative in ensuring a protected flank.

Terrain: A commander could prevent being flanked by anchoring one or both parts of his line on terrain impassable to his enemies, such as gorges, lakes or mountains. Notable examples of this being the Spartans at the Battle of Thermopylae, Hannibal at the Battle of Lake Trasimene, and the Romans at the Battle of Watling Street. Although not strictly impassable, woods, forests, rivers, uneven, and marshy ground can also be used to anchor a flank: Henry V at Agincourt. However, in such instances, it was still wise to have skirmishers covering the flanks.

Fortification: In exceptional circumstances, an army may be fortunate enough to be able to anchor a flank with a friendly castle, fortress, or walled city. In such circumstances, it was necessary not to fix the line to the fortress but to allow a killing space between the fortress and the battle line so that any enemy forces attempting to flank the field forces could be brought under fire from the garrison. Natural strongholds formed by terrain can also be incorporated into the battle line: the Union positions of Culp's Hill, Cemetery Hill on the right flank, and Big Round Top and Little Round Top on the left flank at the Battle of Gettysburg. If time and circumstances allowed, field fortifications could be created or expanded to protect the flanks, as the Allied forces did with the hamlet of Papelotte and the farmhouse of Hougoumont on the left and right flanks at the Battle of Waterloo.

Formations: When the terrain favors neither side, it is down to the disposition of forces in the battle line to prevent flanking attacks. As long as they have had a place on the battlefield, it was the role of cavalry to be placed on the flanks of the infantry battle line. With speed and greater tactical flexibility, the cavalry could both make flanking attacks and guard against them. It was the marked superiority of Hannibal's cavalry at the Battle of Cannae that allowed him to chase off the Roman cavalry and complete the encirclement of the Roman legions. With equally-matched cavalry, commanders have been content to allow inaction, with the cavalry of both sides preventing the other from action.
In a case of no cavalry, inferior cavalry or in armies whose cavalry had gone off on their own (a common complaint), the lack of resulting advantage left the outcome depending on the disposition of the infantry to guard against flanking attacks. It was the danger of being flanked by the numerically superior Persians that led Miltiades to lengthen the Athenian line at the Battle of Marathon by decreasing the depth of the centre. The importance of the flank positions led to the practise, which became tradition of placing the best troops on the flanks. At the Battle of Platea, the Tegeans squabbled with the Athenians on who should have the privilege of holding a flank; both having conceded the honour of the right flank (the critical flank in the hoplite system) to the Spartans. That is the source of the tradition of giving the honour of the right to the most senior regiment present, which has persisted into the modern era.
With troops confident and reliable enough to operate in separate dispersed units, the echelon formation may be adopted. That can take different forms with either equally strong "divisions" or a massively reinforced wing or centre supported by smaller formations in step behind it (forming either a staircase like, or arrow like arrangement). When the foremost unit engages with the enemy the echeloned units remain out of action. The idea is for the enemy to attack the exposed flanks of the foremost unit, but the units immediately echeloned behind the foremost unit would then push forward taking the flankers themselves in the flank. If the echeloned unit is being attacked in turn, the unit behind it would move forward to again attack the flanks of the would be flankers. In theory a cascade of such engagements could occur all along the line for as many units as there were in echelon. In practise, that almost never happened since  most enemy commanders saw it for what it was and so resisted the temptation of the initial easy flanking attack.
That prudence was used in the manifestation of the oblique order in which one wing was massively reinforced, creating a local superiority in numbers that could obliterate that part of the enemy line that it was sent against. The weaker echeloned units was sufficient to fix the greater portion of the enemy troops into inaction. With the battle on the wing won, the reinforced flank would turn and roll up the enemy battle line from the flank.
In the Roman chequer board formation, readopted by Renaissance militaries, each of the units in the front line could be thought of as having two lines of units echeloned behind it.
As warfare increased in size and scope and armies increased, armies could no longer hope to have a contiguous battle line. To be able to maneuver, it was necessary to introduce intervals between units and these intervals could be used to flank individual units in the battle line by fast acting-units such as cavalry. To guard against that, the infantry subunits were trained to be able to form squares rapidly that gave the cavalry no weak flank to attack. During the age of gunpowder, intervals between units could be increased because of the greater reach of the weapons, which raised the possibility of cavalry finding a gap in the line to exploit. Thus, the mark of good infantry was the rapid ability to form from line to square and back again.

Operational flanking: On an operational level army, commanders may attempt to flank and wrong foot entire enemy armies, rather than just being content with doing so at a tactical battalion or brigade level. The most infamous example of such an attempt was the modified Schlieffen Plan used by the Germans during the opening stages of the First World War. That was an attempt to avoid facing the French armies head on, but instead flank them by swinging through neutral Belgium.

Second fronts: Just as at the tactical level, where a commander can attempt to anchor his flanks, commanders try to do the same at the operational level. Examples are the Second World War's German Winter Line in Italy anchored by the Tyrrhenian and Adriatic Seas and the trench systems of the Western Front which ran from the North Sea to the Alps. Attacking such positions would be expensive in casualties and more than likely lead to stalemate. Flanking attacks into areas outside the main zone of contention might be attempted to break the stalemates.
If successful, such operations can be shattering, such as at the Inchon, and break into lightly held rear echelons of an enemy when its front line forces are committed elsewhere. Even when they are not entirely successful, such as at Anzio, the operations can relieve pressure on troops on the main battle front by forcing the enemy to divert resources to contain the new front.
The operations may have strategic objectives such as the Invasion of Italy itself, the Gallipoli, and the Normandy landings.