The war with the Lamanites began in the eighteenth year of the reign of the judges (see Alma 43:3). It ended in the thirty-first year of the same era (Alma 62:39). That is a fourteen-year period. While there were some periods of peace in some areas, there was war to some extent during all of this time.
The war with the Lamanites was basically caused by the wickedness of the apostate Nephites. It was also a war between good and evil (v. 40). The righteous were spared in both the Lamanite war and the war between good and evil because of the prayers of the righteous (v. 40, compare 45:15–16). The Lord had inspired their leaders. The battle of good and evil still continues.
The aftereffects of the war was twofold. Many hearts were hardened and many hearts were softened (v. 41). Again, the same results come from the war of good and evil. We may turn against God and ask why he allows war to happen, and make accusations and rationalizations, as did Ammoron (see Alma 54:15–24), or we can be like the sons of Helaman and turn to God in humility and seek his help. The accounts of the wars are included in the Book of Mormon to teach us these lessons.