The Carthaginian defeat of the Roman Republic at the Battle of Cannae in 216 BCE was their inspiration.
It's a very loose inspiration, though. In real life, here's what happened:
1) Rome was reeling from 2 shocking losses in the previous two years of the 2nd Punic War, so massed their biggest ever army at that time, estimated at 70,000-90,000.
2) Seeing they outnumbered Carthage, whose numbers were 40,000-50,000, they bunched up tightly. At this time Romans normally moved into battle in their maniple tactic (groups of 120 legionaries arranged in 3 lines, with gaps between each maniple. From a bird's-eye view it looked like an elongated checkerboard). However, they removed the gaps they normally left in their columns to assist with moving on the battlefield because they decided to use a brute force push instead.
3) Carthage's commander, Hannibal Barca, spotted that the maniples no longer had the ability to maneouver easily, so he placed his weakest forces in the centre and told his stronger forces on the wings to hold at all costs, while telling the centre they could give ground whenever they needed to.
4) The two armies charged at one another.
5) Rome easily began to push the centre back - but crucially, they did not make any headway on the flanks.
6) Carthage's cavalry swept Rome's from the field. This was common and usually Rome incurred the losses in cavalry with superior heavy infantry.
7) The tightly-packed Romans were now exposed on three sides: the centre and each wing, because of how far forward their centre was and how the Carthaginians hadn't given any ground on the flanks. Only their rear was now clear.
8) The Carthaginian cavalry charged at, and hit the Roman rear.
9) Hannibal ordered all forces to press toward the centre of the Roman army (now completely encircled) at the same time.
10) The Romans were too close together for any given legionary to defend himself. Carthage's forces would stab, press forward, and keep squeezing. Some legionaries made efforts to slash their wrists or bury themselves beneath the crush to suffocate, rather than wait for the time to pass while they were slaughtered.
11) All told, less than 10,000 Roman forces escaped, with about another 10,000 captured (as valuable hostages) and the remainder killed. Rome, as a region, lost 1/5 of its working-age male population in that battle.
12) Carthage awaited Rome's surrender. Unfortunately for them, a Roman motto was: "You're not beaten until you accept defeat," and Rome kept fighting. Initially, they used Fabian tactics (which were, in fact, invented during that war as a response to Hannibal) before Publius Cornelius Scipio (better known by the cool name Scipio Africanus) volunteered to lead Rome's invasion of Hispania. It was a job nobody else wanted, as it was a virtual death sentence, so it was a complete shock to all when he won stunning victories, then went on to invade North Africa. He defeated Hannibal convincingly at the Battle of Zama, ending the 2nd Punic War at the cost of reducing Rome's population by 17% over the war's nearly 20 year period.
13) Nobody made a wall out of a pile of dead bodies.