Verses 21-24 are a small sermonette by Mormon. Of course he knows the history of this people, and he knows that he will include it. These verses not only foreshadow the coming text, but also tell us why Mormon thinks this story is important.
To properly understand Mormon's point, we must realize that the "nevertheless" of verse 22 is meant to be a direct contrast to the "multiply and prosper exceedingly" of verse 21. Mormon has set up a righteous people, doing righteous things, and as we prefer to expect, this righteous people prospered.
What Mormon is telling us is that even righteousness is no guarantee of an easy life. Even our previous prosperous state is not a protection form chastening and a trial of our faith.
His ultimate message is not in the reversal of fortune, however. The ultimate message is the deliverance. Mormon's message, as he summarizes it here, is that while event he righteous will have trials and tribulations, they will eventually be justified and delivered through their righteousness.
This introduction to a particular part of the story of Alma gives us some insight into the editorial mind of Mormon. Why does he chose to tell certain stories, and clearly leave out other information, particularly information historians might be interested in?
Mormon has a didactic purpose in mind for his selection criteria. He is not writing history, he is citing history as examples of the interaction of people and the Lord. We are not to learn in Mormon's text a few historical facts, but rather transcendent eternal principles.
As with many ancient peoples, Mormon sees in history the key to the future (for an interesting discussion of this principle in Judaism, see Taylor, Joan E. The Immerser: John the Baptist within Second Temple Judaism. William B. Eerdmans Publishing Company, 1997, pp. 225-7). By understanding the moral lessons of history, we can understand our future interactions with our God, that same God who has ruled in history.