Bard's original intention of launching an attack against Lonely Mountain to regain some of the wealth meant for rebuilding Laketown which was ruined by Smaug the dragon. Thorin was smittened with the gold and jewelry and was willing to sacrifice friendship just to retain these material posessions.
Thranduil and his army of elves had also set out to battle Thorin's kingdom for a necklace of white gem, in the midst of it all lending aid to Bard in the form of supplies.
At the same time, Azog and Bolg ascended upon the mountain with the armies of orcs, goblins and giant bats to declare war. As such, an alliance was formed between the men led by Bard, elves led by Thranduil and the dwarfs led by Dain to fight against the hideous, half-creatured orcs and goblins. Legolas and Tauriel fought on the side, alongside Thorin who has awoken from his insanity and led his army to join in the fight.
There were some heartbreaks as some of the characters were sacrified, Kili the dwarf amongst them, as Tauriel mourned. Thorin and Azog engaged in an exciting fight in which they managed to kill each other in the end, eliciting victory on the part of Thorin but nonetheless, still heartwrenching as he made peace with Bilbo before he died.
Just as everyone was exhausted, especially after Thrandiul withdrew his army of elves, the Wizards Radagast and Beorn came to aid with their huge fleet of Giant Eagles. There is no need to announce who won the battle in the end.
Overall, the movie though long, is very entertaining with swordsmanship at their best, interesting characters and lots of action. Amongst these, one may also be fascinated by the ethereally, fantasical and surreal beauty of Middle Earth and the rest of the landscapes, and the enjoy the heart-warming fortification of unity. Of course, to admit, the lovely elves are quite an eyeful too, as glacial as their beauty may be. Be prepared to be dazed at this transformation into another world, another era altogether.
This is the third installment of The Hobbit series, and makes one yearn for more after the movie.