The Lord of the Rings
In the early stages of development they have made 90 pages of treatment, and written two scripts for two movies that they were planning to do, but the studio 'Miramax' was seeing it only as one movie. Peter Jackson was forced to look for a different studio, who would be interested in making these movies. The studio that agreed to make these movies, seen them not as two movies but as three. The two scripts had to be re-written and expanded in order to make three movies instead of two.
The writers had to think and create scenes to make the movie more enjoyable to watch. For example, the Pipin and Merry lighting the fireworks during Bilbo's Birthday Party. Glorfindel, Tom Bombadil, characters that were in the book, had to be taken out as they were not relevant to the plot of the movie. Liv Tyler's character 'Arwen' was given more significant role in the movie compared to a book. A story for 'Arwen' was written and included in the film, whereas in the book the character has only few lines. It was done in order for the film to suit the modern views of people; as the believes and views were different at the time the book was written.
For more improvements and ideas, actors were given a script and were free to add ideas for their characters; whether it would be a joke or anything else that would be relevant to the characters. For instance, Frodo playing/interacting with the ring; which makes the ring to be more than a simple thing, like it would be alive.
Furthermore, to fill in the gaps in the story or what was happening before the movie, writers had to write an exposition. The first 'The Lord of the Rings' had a prologue to tell a story of what was happening and why the ring is so important. Otherwise, the audience would not be knowing of what is happening and loose the interest in a movie. There was also an exposition character, Gandalf, who would fill in the holes in the story. The challenge for the writers was to fit it in within actual plot of the movie without breaking the flow of the movie, and not getting carried away from the story as well.