Looking at the point of what Thranduil had done for Bilbo:
Specifically? Nothing was stated. However, Bilbo had had plenty of time to observe him while hiding in his home. He was there long enough to pick up Elvish. Therefore, perhaps he had seen Thranduil's gentler side, especially if he had seen him interacting with Legolas, and so felt guilty about sneaking around and stealing food. Also, it's hinted that he had always had a fastination for Elves. These could have prompted him to feel some compassion for Thranduil and so choose to defend him in the battle and give him the necklace to repay him for all the stolen food and wine.
I'm not going to get into the Arkenstone business because that seems to already have been well covered.