Dain and Thorin Oakenshield's kinship relationship
Dain, son of Nain, is a dwarf-lord of the Iron Hills and a close kinsman of Thorin Oakenshield, being his cousin. He commands a formidable force of more than five hundred dwarves, each clad in steel hauberks and armed with heavy two-handed mattocks, short broad swords, and round shields. His people are renowned for their skill in forging flexible metal mesh hose, a secret of their craft. When Thorin, besieged in the Lonely Mountain by the combined armies of the Elvenking and Bard of Lake-town, sends word by the raven Roäc to summon aid, Dain responds with immediate and rapid march, covering the distance from the Iron Hills in a matter of days.
Arrival and the Siege
Dain's host arrives at the eastern spur of the Mountain while negotiations between Thorin and the besiegers are still underway. The dwarves advance at a great pace, carrying heavy packs of supplies in addition to their weapons, prepared for a prolonged siege. Bard, suspecting that Thorin will not surrender the Arkenstone or pay the promised share once the fortress is reinforced, refuses to let Dain's force pass through the narrow land between the river and the Mountain. The dwarf-messengers sent to parley are met with refusal, and arrows are shot from the Gate when Bard's envoys approach. The situation is on the verge of open conflict between the dwarves of the Iron Hills and the Elves and Men, when a greater threat intervenes.
The Battle of Five Armies
Just as battle is about to be joined, a vast host of goblins and Wargs, led by Bolg of the North, descends upon the valley. Gandalf appears and halts the impending conflict, declaring that the goblins are the common foe. In the council that follows, Dain joins the Elvenking and Bard in a plan to lure the goblins into the valley between the Mountain's arms. During the battle, Dain's dwarves fight with great ferocity, charging into the goblin ranks with cries of "Moria!" and "Dain, Dain!" and wielding their mattocks. They are instrumental in stemming the first onslaught, but the tide turns when goblins scale the Mountain and attack the defenders from above. Thorin leads a sortie from the Gate, and Dain's dwarves rush to his aid, but they are eventually surrounded. The battle is only decided by the arrival of the Great Eagles and Beorn, who turns the tide. Dain's forces, alongside the Elves and Men, pursue the fleeing goblins, driving many into the Running River and the marshes, where the majority of the goblin warriors of the North perish.
Aftermath and Kingship
After the battle, Thorin Oakenshield dies of his wounds. Dain son of Nain takes up his abode in the Lonely Mountain and becomes King under the Mountain. He honors the agreements made by the dead, giving up a fourteenth share of the silver and gold to Bard, and restoring to him the emeralds of Girion, which Dain had recovered. He also crowns the chief of the Eagles with gold and swears friendship with them forever. Of Thorin's twelve companions, ten remain with Dain, and in time many other dwarves gather to his throne in the ancient halls. Dain's rule ushers in a new era of prosperity and peace, with the valley of Dale rebuilt and tilled, and friendship established between dwarves, Elves, and Men.