On the very brink of success, Frodo’s free will having taken him as far as it can, the Ringbearer dramatically renounces the Quest and claims the Ring for his own. His freedom to cast it away has been eroded by the task of bearing it to Mount Doom. What finally saves him is an apparent accident, which is in fact the direct consequence of his own earlier (and freer) decision to spare the life of Gollum. That was an act of pure compassion.
Thus in a way it is not Frodo who saves Middle Earth at all. Even less is it Gollum, who bites the Ring from his hand and in so doing falls into the Fire. It is not even Sam, who has learned compassion from Frodo, and without whom Frodo would never have reached Mount Doom. The Saviour of Middle Earth turns out to be One who works through the love and freedom of his creatures, and who forgives us our trespasses “as we forgive those who trespass against us” (Letters, 181), using even our mistakes and the designs of the Enemy (as already hinted in The Silmarillion) to bring about our good.
The ending of THE LORD OF THE RINGS is a triumph of Providence over Fate, but it is also a triumph of Mercy, in which free will, supported by grace, is fully vindicated.
Stratford Caldecott, “Over the Chasm of Fire: Christian Heroism in The Silmarillion and The Lord of the Rings”