The famine is sufficiently great that “every soul had cause to mourn.” Some would have added grief for lost family members to the famine-borne afflictions. Under such conditions, the people begin to look for a source of hope, and they begin to examine themselves before God, and begin to repent.
These people are supposed to be Nephites, of what are they repenting? Of course we could presume that they considered their individual sins, and repented of those, and that surely happened. However, most of the time, personal sins do not take the form that would be described as “wickedness and their abominations.” What we must remember is that the tension between the way of God and the way of the world was always present in Zarahemla society.
Recently the contention between the two was sufficient that the Amlicites actually broke away from the Nephites and warred with them. We should not presume that every person having some sympathy for the more extreme form of the Amlicites went with the Amlicites, and there were still those in Zarahemla who harbored some of the desires for the world that led to the Amlicite apostasy. This is most likely the nature of the abomination, and the repenting of that abomination would be the most obvious reason why the contentions were eliminated in this year of famine where people were humbled to return to their God.