From Tolkien's Novel: Lord of the Rings: The Fellowship of the Ring, Gandalf and Frodo on Gollum’s Fate.
“But this is terrible!” cried Frodo. “Far worse than the worst that I imagined from your hints and warnings. O Gandalf, best of friends, what am I to do? For now I am really afraid. What am I to do? What a pity that Bilbo did not stab that vile creature when he had the chance!”
“Pity? It was Pity that stayed his hand. Pity and Mercy: not to strike without need. And he has been well rewarded, Frodo. Be sure that he took so little hurt from the evil, and escaped in the end, because he began his ownership of the Ring so. With Pity.”
“I am sorry,” said Frodo. “But I am frightened; and I do not feel any pity for Gollum.”
“You have not seen him,” Gandalf broke in.
“No, and I don’t want to,” said Frodo.” “I can’t understand you. Do you mean to say that you, and the Elves, have let him live on after all those horrible deeds? Now at any rate he is as bad as an Orc, and just an enemy. He deserves death.”
“Deserves it! I daresay he does. Many that live deserve death. And some
that die deserve life. Can you give it to them? Then do not be too eager to
deal out death in judgment. For even the very wise cannot see all ends. I have
not much hope that Gollum can be cured before he dies, but there is a chance
of it. And he is bound up with the fate of the Ring. My heart tells me that
he has some part to play yet, for good or ill, before the end; and when that
day comes, the pity of Bilbo may rule the fate of many—yours not the least.
In any case we did not kill him: he is very old and very wretched. The Wood-elves
have him in prison, but they treat him with such kindness as they can find in
their wise hearts.”