It is amazing that the Nephites had provided themselves with enough provisions to last seven years. No doubt they planned to ration their food during seasons of attack, but replenish them in times of peace.
The Gadiantons apparently spent many months exploring for food and when they could not find any they became desperate. They decided to make an all-out attack on the Nephites in order to survive.