To solve this, the writers (Jackson, Philippa Boyens, and Fran Walsh) took creative liberties. They pulled material from the Lord of the Rings Appendices, historical notes Tolkien wrote that detailed what Gandalf was doing when he left Bilbo’s company.
The Hobbit series consists of the original 1937 fantasy novel J.R.R. Tolkien and a subsequent film trilogy directed by Peter Jackson released between 2012 and 2014 The Hobbit series