I wonder if Tolkien ever explained why Gandalf insisted that Bilbo should go with the dwarves on their journey to reclaim Erebor. Gandalf didn't know about the One Ring and Gollum at that time. Did Gandalf foresee something or was he just thinking that Bilbo would be crucial for defeating Smaug (which Bilbo in the end of course was)?
There is no explicit answer, but in the Hobbit, the following passage occurs:
"Of course there is a mark," said Gandalf. "I put it there myself. For very good reasons. You asked me to find the fourteenth man for your expedition, and I chose Mr. Baggins. Just let any one say I chose the wrong man or the wrong house and you can stop at thirteen and have all the bad luck you like, or go back to digging coal." He scrowled so angrily at Gloin that the dwarf huddled back in his chair; and when Bilbo tried to open his mouth to ask a question, he turned and frowned at him and stuck out his bushy eyebrows, till Bilbo shut his mouth tight with a snap. "That's right," said Gandalf. "Lets have no more argument. I have chosen Mr. Baggins and that ought to be enough for all of you. If I say that he is a Burglar, a Burglar he is. or will be when the time comes. There is a lot more in him than you guess, and a deal more than he has any idea about himself. You may (possibly) all live to thank me yet. Now Bilbo, my boy, fetch a lamp, and let's have a little light at this."
So the dwarves wanted another member for their journey, and Gandalf thought Bilbo would fit (presumably a full-sized man or elf would be out of place among the dwarves). Bilbo was a relative of a slightly 'less respectable' group of hobbits - the Tooks, who were known to be adventurous.
This question is answered in full in the book Unfinished tales : The quest of Erebor. As far as defeating the dragon goes Gandalf had his own reasons aside from the Dwarves for seeing the dragon dead. Gandalf feared an alliance between the Necromancer (Sauron) and Smaug would lead to the dragon attacking the Elvish strongholds of Lothlórien and Rivendell.
Thorin initially wanted to take an army of dwarves to slay the dragon Gandalf counselled against this. Advising that a smaller stealthy party approaching the mountain would have more success. He said Thorin needed two things first: a secret entrance which he told Thorin where to find and secondly he needed a thief trained in the arts of stealth who could get Thorin and his companions inside the mountian and he persuaded Thorin that Bilbo was such thief.
Because Bilbo asked him to go (or at least Gandalf believed so)!
"All the same I am pleased to find you remember something about me. You seem to remember my fireworks kindly, at any rate, land that is not without hope. Indeed for your old grand-father Took's sake, and for the sake of poor Belladonna, I will give you what you asked for."
"I beg your pardon, I haven't asked for anything!"
"Yes, you have! Twice now. My pardon. I give it you. In fact I will go so far as to send you on this adventure. Very amusing for me, very good for you and profitable too, very likely, if you ever get over it."
Sorry, I am not satisfied with the answers given here to that question, because Tolkien knew exactly the answer to that question. It has 2 levels. First the rational one for Thorin: in Unfinished Tales - "The Quest to Erebor", Gandalf insists on this:
"Take a hobbit with you! Smaug has probably never heard of hobbits and he has certainly never smelt them." That is the reason Gandalf gave to Thorin….
Then, there is the metaphysical one: Gandalf was the wisest of the Maïar and was specifically chosen by Manwë for the Istari mission because of that (see Unfinished Tales - "The Istari"). Also of course, like all Valar and Maïar, having been one of the singers of the music of Illuvatar at the beginning of time he knew much of what would happen in Arda throughout time. And even if in his human form as a wizard sent to Middle-Earth by the Valar he didn't have the full memory of these things and his full Maïar powers, he was still the wisest of them and somehow knew in his heart that the Hobbits would play a great role in the events to come. In The Silmarillion - "Of the Rings of Power and the Third Age", he said this to Elrond after a council of the wise that happened before the quest to Erebor:
"Many are the strange chances of the world, and help oft shall come from the hands of the weak when the wise falter".
And that is the reason why he insisted so much on the dwarves taking Bilbo with them. He didn't really knew the why, but his instinct told him the how. That is even why he was interested in that quest to begin with. Else, he wouldn't even have bothered about dwarves wanting their gold back, that was of no interest to him, that is quite obvious from his attitude with them.
Gandalf didn't have the Ring in mind for the quest, but he did obviously have Sauron in mind, and as stated before, preventing an alliance between Sauron and Smaug was one of his reasons for helping. Really there's no special answer to this very important question. Gandalf didn't "consult" anything to pick Bilbo. He picked him as an educated guess, or even a hunch. Bilbo simply had the qualities that Gandalf was looking for. He was the best candidate. So in a way, yes, the fact that Hobbits aren't easily corrupted, regardless of the ring, their simplicity and goodness is also one of the reasons why Bilbo was picked. A Hobbit was needed. It's just because Gandalf is wise, this is one example of where he makes a truly wise decision that's not easy to explain.
Looking back I think that the oneof the reasons Gandalf wanted the go on this quest was to look for the ring. He knows that hobbits aren't easily corrupted by the ring. And because he had a relationship with bilbo he asked him. Killing Smaug was only a reason he used to convince the dwarves to go on the quest, but the main reason for going was to find the ring.