This is a short episode wedged in between some preparatory events in ch. 5 – the mass circumcision of the men of military age who had been born in the wilderness; the first Passover in Canaan; eating the fruit of the land and the end of the manna – and the narrative of the siege of Jericho in ch. 6. The setting is the plain of Jericho, although it’s ambiguous whether Joshua is near Jericho or “in” Jericho.
Joshua sees “a man” – who is never identified as an angel, but tradition pegs him as an angel, and the archangel Michael at that – the “man” behaves like other heavenly actors in some other stories. When Joshua asks him “are you here for us, or for our “adversaries” or “enemies” or “foes,” the man answers “no” – in context, “neither,” but one of those cryptic statements, economical of words; and identifies himself as the “chief/prince of the hosts of YHWH” – arrived, for some unstated purpose. Presumably, to play some role in the upcoming conflict, but what role remains unclear.
Joshua is overwhelmed, prostrates before the angel, and requests further instructions from the angel, who instructs Joshua to take off his shoes because the place where he is standing is holy – another parallel with the story of Moses in Exodus. Joshua once again appears as a second Moses.
The episode is dramatic. The language is very simple: common verbs, common forms. The leader of the hosts of YHWH is unusual, putting in a rare but not unique appearance: there are a couple of other occasions when the hosts of heaven make themselves known (e.g., 2 Kings 6:17, when Elisha sees the chariots and armies of heaven that Elijah has already seen). People often feel this text is really just a fragment of a longer story, that we no longer have.
It may say something, or imply something, about the nature of “God’s providence;” that it is not strictly speaking committed to one “side” or another of a conflict – but has some other, undisclosed purpose, presumably (at least) good, presumably having something to do with fighting … but only rarely discernible by humans.
[edited for grammar 09.26.16]