A lot has been written about this but I think the key factors can be identified (thanks to Gregory Stanton) as:
- The Romans' ability to learn from their opponents and to adapt their tactics.
- The emergence of capable leaders, like Fabius Maximus and Scipio Africanus, who produced the sort of tactics suitable to the occasion.
- The greater resources, particularly of man-power, available to the Romans. When the treasury was depleted, it was made up with voluntary contributions. The enormous losses of men in the early battles of the Second Punic War down to Cannae were quickly made up.
- The loyalty of the Italian allies, particularly those in central Italy. This explains the resources of man-power, since the Italian allies provided a large percentage of the troops in Roman armies. The allies in the main had remained faithful to their alliance with Rome during the Second Punic War. Hannibal had counted on winning over many of the allies, and their refusal to open their gates to him posed a problem for him in maintaining his army in a foreign land. The loyalty of the central Italian allies particularly prevented the Gauls in the north, who sided with Hannibal after the battles at the Ticinus and the Trebia, from linking up with those Italian allies in the south who went over to his side after Cannae.
- The Romans, as well as the Italians (who suffered as much from Hannibal's depredations in Italy), were citizen-soldiers fighting for their native land, whereas the Carthaginians had to rely on mercenary troops or troops pressed into service from conquered and exploited countries, whose devotion to the Punic cause was therefore questionable.
- The failure of the Carthaginians to send reinforcements to Hannibal, despite his repeated requests. This was due partly to Rome's control of the sea which made it difficult for Carthaginian ships to reach Italy, partly to the fact that Carthage had not rebuilt its fleet after the First Punic War, so that it did not have the ships to send help anyway, and partly to divisions within politics at Carthage. There are hints of an anti-Barcid faction, opposed to the war-party led by the Barcas; this suggests that there was a division of opinion about the advisability of making or continuing war with Rome.
- The consistency and steadiness of the Roman senate was a vital factor in the maintenance of morale and of the war effort. Being a permanent body, in contrast to the annually changing magistrates, it was able to impose a consistent direction on policy. The people too were somewhat discredited by the failure of leaders like Flaminius (who foolishly led the Roman army into the trap at Lake Trasimene) and Terentius Varro (whose inexperience led to the disaster at Cannae), whom the people had pushed into office contrary to the wishes of the senate.