It was used as a defense technique to hold-off an attacking enemy. The soldiers would form two closely-packed ranks that would act as shield-walls. These ranks of soldiers would be bent back adjusting for the enemy’s charges keeping either end from being outflanked, and then becoming a closed ring of unbroken shields that would continue fending off further attacks.
During the Disaster of the Gladden Fields, Isildur, realizing that he could not do anything else because the ground didn't work in his favor was forced to use this battle tactic to defend himself but was overwhelmed in the end.
Thangail is the Sindarin translation of the official Quenya word 'sandastan' which was derived from the primitive forms of thandā, meaning 'shield' and stama, meaning 'bar'. The Sindarin breakdown was than, meaning 'shield' and c(g)ail, meaning 'fence'.
- Unfinished Tales pgs. 272 & 281