The Battle of the Drill was a battle fought outside the Outer Wall of Ba Sing Se during the War. It was an assault by the Fire Nation using a drill, a massive device solely intended to drill a path through Ba Sing Se's massive walls to allow for a larger invasion. The Drill was destroyed and the Fire Nation thus defeated due to the intervention of Team Avatar.
The Fire Nation had wanted to conquer Ba Sing Se since the beginning of the war. Successfully taking the city would remove much of the Earth Kingdom's resources, and cripple the Earth Kingdom leadership by removing the Earth King and the Council of Five. However, their efforts, including the 600-day Siege of Ba Sing Se by General Iroh, had all failed.
The Mechanist was designing weapons for the Fire Nation, and the Fire Nation created plans for the drill using his information. The Fire Nation began constructing the massive drill in another attempt to break through the outer and inner walls of Ba Sing Se. It was their hope that by clearing a path for their armies, the city would be conquered.
After completion, the drill and a small force of Fire Nation tanks headed towards the great city to break in. Unfortunately for the Fire Nation, the force arrived at the exact time as Team Avatar and Aang spotted the device.
Ba Sing Se's army was unprepared due to never having fought a major battle in years and their only means of defense were throwing boulders at the Drill, which had little success. General Sung who commanded the troops on the Outer Wall, did not see the Drill as a real threat and was confident in the Terra Team, a group of elite Earthbenders. Despite their best efforts, they were however no match for Ty Lee and Mai, who promptly ambushed the soldiers. Ty Lee's chi blocking knocked out the entire team within mere moments. With the team helpless, Sung panicked and wanted Team Avatar's help despite his earlier thoughts of not needing it at all.
Team Avatar came up with a plan of hitting the Drill's pressure points as Ty Lee had done to defeat the Terra Team. Aang, Katara and Sokka broke into the Drill when Toph tried to slow it down from the outside because she could not bend metal at this point in time. Having stolen a schematic from a Drill worker, the group headed for the front-most part of the Drill where massive metal braces held the entire thing together. Aang and Katara began cutting completely through the braces using waterbending, but found it was too much work to be done before the Drill broke through the wall. Sokka suggested that they didn't need to cut through the braces completely and that Aang could deliver a final blow that would destroy the weakened braces. Meanwhile, the crew found the Drill worker that Katara had frozen earlier, so Azula went to averiguate the situation along with Mai and Ty Lee. The Gang fled as they could not fight and cut through the braces at the same time.
Aang eventually separated from Sokka and Katara to deliver the final blow. Katara and Sokka managed to escape the machine from riding slurry (a mixture of water and earth used to deposit the rock from the wall). Ty Lee followed them in the pipe, but Mai did not stating "Azula can shoot all the lightning she wants at me, I'm not going in that wall sludge juice." Because the slurry is water and earth combined, both Katara and Toph were able to bend it from the outside and build up more pressure for when the blow was delivered. Ty Lee was trapped in the slurry since she had not given up pursuit. Meanwhile, Aang dodged falling boulders from Sung's men as Sung thought that this would be an effective measure, even though it clearly wasn't. He also fended off Azula as he cut a hole into the metal exterior using waterbending. Initially, Azula maintained the upper hand, dodging all of Aang's attacks, be they Earthbending, Waterbending, or Airbending. Eventually, she launched a massive fire blast that knocked Aang unconscious. As she prepared to deliver the killing blow, Aang recovered and fought her off with Earthbending. After removing her from the fight, Aang continued with the destruction of the drill. Aang uses the rock to his advantage and makes a wedge shape that he shoves into the front of the Drill. He then uses airbending to speed-run down the outer wall. Azula launches a last-ditch attack to save the Drill, but this fails and Aang lands on the wedge, launching Azula off the Drill.
Aang's powerful attack causes the weakened braces to break apart simultaneously, causing the Drill to collapse into a slurry mess, its pipelines exploding as the vehicle caves in. The entire area was flooded, and it buried a large number of the Fire Nation troops escorting the vehicle or working within. Ty Lee was ejected from the slurry system but was largely unharmed. Azula also managed to escape injury. In the wreckage, a pristine and nonchalant Mai humbly says "We lost".
The Battle of the Drill was a victory for the Earth Kingdom, once again stopping the Fire Nation from penetrating the Outer Wall. They were forced to return to the shores to await another opportunity to strike. Unfortunately, this victory was short-lived, as Azula would return to conquer Ba Sing Se several weeks later.
The drill wreckage was not immediately cleaned up or disposed of, but this proved to be a major help for Team Avatar.
At least a month later, the gang used the drill as proof of the War to Earth King Kuei, who had been kept unaware of the War by the power-hungry cultural enforcers of the city, the Dai Li. Their leader, Long Feng, tried to convince the king that it was "a construction project" but the king didn't believe him. This resulted in Long Feng's arrest. Kuei subsequently began to take more decisive action against the Fire Nation in the days prior to the city's capture.