When the dwarves find and wake Smaug the dragon, the battle of the five armies ensues over the control of Erebor and the treasure it houses.
When the dwarves find and awaken Smaug the dragon, the battle of the five armies ensues, between the Goblins and the Wargs, against the Men of Lake-town, the Elves, the Dwarves, the Eagles and Beorn, over the control of Erebor and the treasure inside it.