Bilbo knows his birthday is coming up, and so as the Company leaves Beorn's house, he starts thinking of gifts to give them once it comes. He doesn't really know what to give dwarves, but he's determined to get it right. He's figured out by this point that dwarves value their craft and things made with a dwarf's own hand, so during his time hiding in the halls of the elves, he starts writing poems personalized to each of them in his head. Then the first night in Laketown, he gets his hands on some paper, writes them down, and hands them out. This, it turns out, requires some degree of explanation about hobbit birthday traditions, and then Thorin spends a moment panicking about not making Bilbo a birthday present even though Bilbo literally just told him hobbits don't do it that way. That is, until Bilbo marches up to him and demands he actually READ what Bilbo wrote for him. Most of the Company's poems are short and sweet, due to time and mental storage constraints, but Thorin's is three pages long and practically screams 'I'm in love with you you big dumb lump'. At which point Thorin kisses Bilbo in front of the entire Company, and after he finally pulls away, Bilbo informs him that if he insisted on giving Bilbo a present, that was a pretty good one.
(Of course, then Thorin gives him the mithril as a belated birthday present, and Bilbo loses it because they literally had gone over this, but that's another story.)