I'm sure it'll be based off the conversation Gandalf has with Frodo about Gollum's activity where the Rangers are trying
to hunt him down as he travels to Mordor, tells Sauron everything he knows about the location of the Ring, and then returns to the Shire looking for Bilbo. During that time he was captured and held by the Woodland Elves but escaped.