How did God save the people of Alma from the Lamanites?

By making the Lamanites go into a deep sleep

In the morning the Lord caused a deep sleep to come upon the Lamanites, yea, and all their task-masters were in a profound sleep. And Alma and his people departed into the wilderness. Mosiah 24:19-20