In "Leiningen Versus the Ants" by Carl Stephenson, Leiningen is an experienced plantation owner who has built a compound in the jungle of Brazil. Before building it, he spent some time living there, so he is quite aware of the natural hazards of the country--one of which is the ants which one Brazilian official describes as "an act of God." Because of that, he has built several significant precautions into his plantation which he believes will keep him and his people safe from the ravages of the marauding, ravenous ants.
The first line of defense is a weir along the outer perimeter. It is a kind of dam which he will flood when the ants arrive, preventing them from crossing and getting access to the main plantation compound. The second line of defense is an inner moat which he will fill with oil if any of the ants manage to reach it.
When the plague of ants reaches the weir and they are unable to cross, Leiningen feels comfortable that he will be victorious in this battle; however, the ants recover and strategize (a most frightening occurrence, to be sure) before communicating to one another that they must cross the dam on the backs of the ants who have been drowning. To combat this, Leiningen orders his men to increase the flow of water so the creatures are swept away by the swift current. For a time, Leiningen is confident that he has won an easy victory.
Dawn found a thoroughly refreshed and active Leiningen riding along the edge of the ditch. The planter saw before him a motionless and unaltered throng of besiegers. He studied the wide belt of water between them and the plantation, and for a moment almost regretted that the fight had ended so soon and so simply. In the comforting, matter-of-fact light of morning, it seemed to him now that the ants hadn't the ghost of a chance to cross the ditch. Even if they plunged headlong into it on all three fronts at once, the force of the now powerful current would inevitably sweep them away. He had got quite a thrill out of the fight--a pity it was already over.
Leiningen is not disappointed for long, as the ants begin a new siege on the plantation. Though it takes some time, the ants regroup and centralize in a place where they can drop leaves into the water, creating a kind of bridge over which they can cross.
Leiningen's men again manage to slow down the approaching horde, but eventually they manage to reach the last line of defense, the moat of petrol (oil). After having conquered the weir, the ants do not need as much time to figure out how to cross the black goo by using branches and twigs as rafts to get across.
Your question refers to the ants' recovery, and I assume that refers to their ability to stop, regroup, and think when it seems that their forward movement has been stopped. These are the two significant time where this happens, and the usually calm and unflappable Leiningen is shaken by what he sees them do. Both times he was confident that the fight had been won and then horrified to realize that he was close to being outsmarted (and nearly killed) by these marauders. It is a frightening thing for the plantation owner to realize that he is being outwitted by this "act of God," and he can see them thinking and strategizing and regrouping just as if they had been a human army. It is a terrifying thing to contemplate one's imminent death; it is another thing entirely to contemplate being overcome and eaten alive by a throng of vicious ants. Leiningen wins, but not by much.