Nephi asserts his prophetic right and power to predict a coming destruction by referencing an account from sacred history. God gave power to Moses to open the waters of the Red Sea, so God could give power to Nephi to speak prophetically. The imagery is not haphazardly chosen, however, When Moses the true prophet opened the red sea, it led to the destruction of the army of a very powerful nation. That powerful nation was wicked, and the Lord preserved his righteous people.
Obliquely, Nephi is using that metaphor for the destruction of the Gadiantons. They have proclaimed themselves and their cities powerful, but so did the Egyptians of Moses’ time. They have declared their army strong, but so was the army of the Egyptians. The Egyptians were wicked because they did not follow the ways of God, and the Gadiantons are similarly wicked because they do not follow the ways of God. Moses was a prophet given prophetic power from God, and Nephi now has that same power, and has declared that same destruction to come upon the wicked Gadiantons as came upon the wicked Egyptians.