Imagine you’re on the way to fight the first battle of a major invasion. Your way there is blocked by a man brandishing his sword. You would, just as Joshua did, want to know whose side the man is on: is he a friend or a foe?
5:14 ‘Neither one,… I am the commander of the Lord’s army.’ At this, Joshua fell with his face to the ground in reverence. ‘I am at your command,’ Joshua said. ‘What do you want your servant to do?’
Even in a battle as important as this, and even though God had already said who would win, the emphasis from God wasn’t whose side He was on, but on His holiness.
5:15 The commander of the Lord’s army replied, “Take off your sandals, for the place where you are standing is holy.” And Joshua did as he was told.