I am told that the extraneous bits in the movies (like all of the elf-politicking and Gandalf's absence) are in the appendices and other material that Tolkein wrote.(I have not confirmed this for myself.) Putting these scenes in instead of merely sticking strictly to the content of The Hobbit enables the movie-maker to a) do more expansive world-building, b) more clearly tie the events of The Hobb