In Mosiah 18:33-35, King Noah said, "Alma was stirring up the people to rebellion against him." Therefore, he sent his army to destroy him. There were about 450 persons who congregated around Alma, and who, too, believed in the words of Abinadi.
Alma had friends among the officers and men in the king's army; we may presume that one was Gideon, and that Alma was appraised of the king's intent. In verse 1, we are informed that the Lord warned Alma of the danger which was imminent. Whether it was made known to Alma by the direct interposition of God's power, or His operating through Alma's friends, the record does not state, nor does it matter; "God moves in a mysterious way." It was made known to Alma, and he in turn advised his followers. They, therefore, took their belongings, their flocks and herds, and grain, and "departed into the wilderness before the armies of king Noah."