Having just read the LOTR+Hobbit series for the first time in my 32 years, I want to correct something:
Gollum was a Hobbit-like creature but not a Hobbit. I believe the name of his species was a “Stoor.” They liked to swim and eat fishies, hence the big feet and hands.
Gandalf’s hard work in studying obscure creatures like Hobbits and Stoors (as JRRT studied obscure myths and linguistic matters) was part of why he was able to stay ahead of Sauron’s plans. One of his key insights was that these simple creatures were somewhat more immune than Men to the corrupting influence of the Ring. Even Gollum had a shred of conscience left after spending such a long time with the Ring and he did not try to take over the world when he had it. Early in the book, Gandalf presciently notes upon learning that Gollum escaped, that he may yet have a constructive part to play in the story so that its not such a big deal that he got free.