This is a difficult poem to understand. It was written in context as part of the original text for The Lord of the Rings, Volume I, The Fellowship of the Rings and introduces key plot points as part of Gandalf's letter to the hobbits. Bilbo reveals to Frodo that he wrote it years earlier, thus it is prophetic in character. Tolkien adapted it from a similar though thematically opposite verse in Shakespeare's The Merchant of Venice:
All that glitters is not gold;
Often have you heard that told:
Many a man his life hath sold
But my outside to behold:
Gilded tombs do worms enfold.
Had you been as wise as bold,
Young in limbs, in judgment old,
Your answer had not been inscroll'd:
Fare you well; your suit is cold.
Cold, indeed; and labour lost:
Then, farewell, heat, and welcome, frost! (II.vii)
The lines of Tolkien's poem refer to things within the land of the Rings, not to our world, yet Tolkien's son, Christopher, makes the poem relevant when he talks about the "general moral" of the poem.
[Narsil] actually emerged from the verse 'All that is gold does not glitter': on this view, ... [other lines were] a further exemplification of the general moral. (Wikipedia)
According to the article in Wikipedia, the contextual references are these. Line one refers to Aragorn. Line two refers to the Rangers. Lines three and four refers to Aragorn's royal lineage. Lines five and six refer to the continuation of that royal line. Line seven talks about Narsil, the sword. Line eight prophecizes the return of Aragorn to kingship over Gondor and Amor.
The contextual theme--within the text--is the robust continuation of the Royal House of Aragorn. The general moral is the robust resilience of "the good" who will not remain beaten down by foes or circumstances, even if for a while "the good" seem lost and withered and quenched. This general moral is the theme that can be applied to those of us living outside Middle-earth.
Some quotes from the poem that support this moral/theme are these:
- robust resilience: "Renewed shall be the blade that was broken,"
- won't remain beaten down: "Deep roots are not reached by the frost."
- lost, withered, quenched:
All that is gold does not glitter,
Not all those who wander are lost;
The old that is strong does not wither,
From the ashes a fire shall be woken,
A light from the shadows shall spring;