> In the original 1937 edition of "The Hobbit" Gollum was genuinely willing to bet his ring on the riddle game, the deal being that Bilbo would receive a "present" if he won. Gollum in fact was dismayed when he couldn't keep his promise because the ring was missing. He showed Bilbo the way out as an alternative, and they parted courteously.
> As the writing of LotR progressed the nature of the Ring changed. No longer a "convenient magical device", it had become an irresistable power object, and Gollum's behavior now seemed inexplicable, indeed, impossible. In the rough drafts of the "Shadow of the Past" chapter Gandalf was made to perform much squirming in an attempt to make it appear credible, not wholly successfully.
> Tolkien resolved the difficulty by re-writing the chapter into its present form, in which Gollum had no intention whatsoever of giving up the Ring but rather would show Bilbo the way out if he lost. Also, Gollum was made far more wretched, as befitted one enslaved and tormented by the Ruling Ring. At the same time, however, Bilbo's claim to the Ring was seriously undercut.
In the original version of The Hobbit, the ring is just a magic ring and Gollum willingly bets the ring on the riddle game. When Gollum can't find the ring, he instead offers to lead Bilbo out of the cave.
In later versions, the bet was if Gollum wins he eats Bilbo, if Bilbo wins Gollum shows him the way out.
It is then presented that Bilbo told everyone the first story although the second was the truth. Which is why the first version appears in The Hobbit as the conceit is that it is an account written by Bilbo or at least sourced from his writings.
> As the writing of LotR progressed the nature of the Ring changed. No longer a "convenient magical device", it had become an irresistable power object, and Gollum's behavior now seemed inexplicable, indeed, impossible. In the rough drafts of the "Shadow of the Past" chapter Gandalf was made to perform much squirming in an attempt to make it appear credible, not wholly successfully.
> Tolkien resolved the difficulty by re-writing the chapter into its present form, in which Gollum had no intention whatsoever of giving up the Ring but rather would show Bilbo the way out if he lost. Also, Gollum was made far more wretched, as befitted one enslaved and tormented by the Ruling Ring. At the same time, however, Bilbo's claim to the Ring was seriously undercut.
http://tolkien.cro.net/tolkien/changes.html