FRODO: It’s a pity Bilbo didn’t kill [Gollum] when he had the chance.
GANDALF: Pity? It was pity that stayed Bilbo’s hand. Many that die deserve life, and some that live deserve death. Can you give it to them, Frodo? Do not be too eager to deal out death in judgment. Even the very wise cannot see all ends. My heart tells me that Gollum has some part to play, for good or ill, before this is over. The pity of Bilbo may rule the fate of many.
(The Lord of the Rings: The Fellowship of the Ring by J.R.R. Tolkien)
Gandalf is a wise figure in the trilogy of The Lord of the Rings, and has some prophetic powers. Frodo laments that the monstrous creature of Gollum is still alive to torment and obstruct him. However, Gandalf foreshadows an important role that Gollum will play. When Frodo finally brings the One Ring to Mount Doom, but finds himself unable to destroy it, as it has gained power over him. Only the struggle with Gollum leads to the destruction of the ring, an event that Frodo cannot foresee.