As Thorin continues to search for the Arkenstone and as the rest of the dwarves worry about the armies camped on their doorstep, Bilbo decides that he must take matters into his own hands. With the help of the ring, he sneaks away from the mountain at night and into the camp of the lake men and the wood elves. There, he reveals himself and is brought before the leaders, Bard and the Elvenking. They are suspicious of him, of course, but they relax when Bilbo reveals his secret weapon: the Arkenstone. He gives it freely to Bard to be used as a bargaining chip against Thorin. Bard and the Elvenking are amazed that the hobbit would risk inciting the anger of the dwarves in order to prevent a war. They ask him to stay in the camp for his safety, but Bilbo decides to return to the mountain. On his way out of the camp, he runs into Gandalf, who pats him on the shoulder for his brave deeds. Gandalf has just arrived from his other affairs to see the end of this touchy matter. Newly hopeful, Bilbo sneaks back to the mountain unnoticed.
In the morning, Bard returns with two messengers to entreat Thorin to accept a peaceable agreement. When the dwarf again refuses, Bard reveals the Arkenstone, the one part of the treasure that Thorin values above all the rest. Thorin is crushed, and he turns to Bilbo in rage when the hobbit reveals that he is the one who gave Bard the treasure. Thorin is about to turn violent, but then one of the messengers throws off his cloak and reveals himself to be Gandalf.
The wizard commands Thorin to let Bilbo speak. The hobbit claims that, in taking the Arkenstone, he only took his fair share of the treasure, as his contract as burglar had specified. Thorin has no choice but to agree, and he angrily offers to pay a fourteenth part of the treasure to regain the stone. The men and elves are satisfied with this. Thorin, however, secretly hopes that before they make the exchange, his relatives, who are marching toward the battlefield with an army under the leadership of Dain, will be able to capture the stone by force.
The new dwarf army threatens the elves and men, and they are about to engage in battle when darkness takes over the sky from the west. Gandalf tells them that a new danger has come: an army of goblins and Wargs who intend to take the treasure for themselves. The dwarves, elves, and humans are thus united against the goblins and Wargs in what is called the Battle of the Five Armies.
The forces of good fight fiercely, but the goblins and Wargs are just as fierce. Bilbo stays on the mountain, a bit removed from the fighting, and watches as the elves and dwarves first send the goblins fleeing but then are forced to retreat from the vicious Wargs. Thorin fights alongside the lake men as mightily as any. However, the goblins slowly gain ground, and Bilbo is forced to retreat to the elves’ camp, which is nearly surrounded. The end seems close at hand when the hobbit’s keen eyes spy something in the distant skies: the great eagles are flying toward the battlefield. At that moment, however, a stone falls from the mountain and hits Bilbo on the head, and he loses consciousness.
In this section, the idea Tolkien began developing in Chapter 15—that the dwarves are in the wrong and that the truly heroic path is the one that ends in peace—comes to fruition with Bilbo’s moral choice to leave the dwarves. Bilbo’s motivations for defecting to the enemy camp are twofold. First, he realizes that the best way out of the conflict is a peaceful one. Second, despite his friendship with the dwarves, Bilbo feels more of a natural camaraderie with elves (and, to a lesser extent, with men) than with dwarves. Though this second motivation may be questioned, Bilbo’s defection is nevertheless one of the most courageous acts of his short career as a burglar, since without Gandalf’s intervention he may easily have been killed by Thorin for giving away the Arkenstone.