Verses 23 and 24 form an interesting contrast. In verse 24 we have the essential information that Nephi and Lehi were surrounded by fire, and were not burned. This statement comes from the vantage point of the Lamanites, as it notes that the Lamanites were fearful to lay hands on Nephi and Lehi lest they be burned.
Verse 24 shifts to the perspective of Nephi and Lehi. It appears to suggest that they were surprised as the flames as well, and “did take courage” when they found that they were not being burned. Mormon therefore presents us both sides of the event as having been surprised at the presence of the fire.
Literary: This incident has obvious similarities to the experience of Shadrach, Meshach, and Abed-nego as related in Daniel 3:19-28. In both cases we have men surrounded by a fire that miraculously does not harm them. Even though the similarity is obvious, there are significant differences, and a meaning in the Mesoamerican context that suggests that the similarities are superficial, and that this event has its own internal meaning in the Book of Mormon.
The first difference in the two stories is the origin and purpose of the fire. In the Daniel story, the fire is a real-world fire designed to consume those thrown into it. In the Book of Mormon the fire is a spiritual creation designed to protect those found inside it. In cultural context, however, there is an even greater likely meaning. The Lamanites had come to sacrifice Nephi and Lehi to their Lamanite gods. One of the forms of sacrifice was live immolation. Thus when the Lamanites come to bring Nephi and Lehi to sacrifice, they find them in what appeared to be an act of autosacrifice. Autosacrifice tied the Maya kings to the actions of the divive, and among the later Aztecs it was the autosacrifice of Nanahuatl in a fire that created the sun that rules over this age.
The cultural meaning of the apparition that was presented to the Lamanites was that of a symbolic sacrifice from which life was immediately present. The only cultural explanation was that Nephi and Lehi were divine, or participated in the essence of the divine.