The phrase like the sand of the sea
refers to the enormous size of the assembled army—beyond counting, just like grains of sand on the seashore or seabed. This describes the seed of the serpent
of Genesis 3:15. Note that in Genesis 6:1–2 the entire human population except for Noah (whatever the number of this population was) had been deceived to align with the serpent. All ended up, we might say, on the seabed of the flood.
The use of the phrase in the present context of the battle
recalls its use in Israel’s battles with their enemies (Joshua 11:4; Judges 7:12; 1 Samuel 13:5). The phrase implies a gross imbalance in the size of the competing armies and so the impossible disadvantage (from a human perspective) facing God’s people. With the use of the phrase in the present case, John communicates that the advantage appears distinctly to be on Satan’s side.
In line with the above, the use of the phrase is reminiscent of the victory that God worked through Joshua, Gideon, and Jonathan (see above texts) with few men over vastly outnumbered (and superior) hoards. That is prophetic of the outcome of the present battle.
8 and will come out to deceive the nations that are at the four corners of the earth, Gog and Magog, to gather them for battle; their number is like the sand of the sea.