The Romans could muster many many legions: the Second Punic War is a Monty Python sketch of this (I raised one army and it was destroyed, I raised another army it and it was ambushed and destroyed, I raised a massive third army and it was enveloped and wiped out, but this army I just raised is the strongest army yet...) Rome commanded massive manpower reserves in both its citizens, but more importantly, in allied states that were compelled to supply armies for Rome and who fought in the Roman manner. So even if you wiped out a Roman legion (or two), another one would be raised the following year to avenge that defeat.
It's organization: the organization up until the Late Republic was the Manipular Legion, 3 lines of heavy infantry each subdivided into 10 maniples. In the Late Republic it was reorganized into 10 larger cohorts that were still deployed in 3 lines. The multiple lines meant you could relieve/reinforce the front if needed. The cohort (and maniple to a lesser extent) was a large tactical unit that could maneuver relatively easily on the battlefield. You can see this in Cynoscephalae where an officer pulled 20 maniples to attack the opposite wing of the enemy.
The leadership: The Roman general was expected to stay behind his front line and command the army. He was never expected to personally fight - that was a sign that things had gone pear-shaped. This meant he could see parts of the line that were failing and order up reserves or go in person to rally them. There were also 6 tribunes within the legion that had command power - one of them ordered the maneuver at Cynoscephalae mentioned in #2. The legions also had a lot of junior officers, the cohort legion had about 40 per legion (2 centurions and 2 optio's per cohort) for leadership.
Experience: Rome was constantly at war and even using a militia system it meant a fair number of the men in any army would have seen prior service. They were still fairly fragile upon mustering (as it was a wholly new formation and needed to develop cohesion) but I'd warrant any civic militia would be as well. By the late Republic the militia element was gone and you had men volunteering for the duration of a war - and with the conquest of Gaul taking a year this meant that some legions were extremely experienced and tough. Under the principate you had a fully permanent standing army that could spend all its time training and patrolling the borders.
Edit: I missed additional factors listed below.
Equipment: By the Late Republic the ordinary soldier was equipped to very high standards in comparison to many of their opponents. The Roman state could equip each legionary with a mail shirt - which is a ridiculously expensive piece of equipment formerly only affordable by the very rich. They'd even developed lorica segmentata which required considerable technical skill.
Logistics: This is another huge advantage. The Romans in the Second Punic War supplied three field armies simultaneously throughout an entire year - in Spain, Italy, Sicily. Tribal armies had none of that capability and couldn't keep an army in the field for long or even mass a great number as they mostly lived off of the land. Rome could import and move the tons and tons of grain and fodder needed each day over hundreds of miles and across oceans. This gave them an all-year-round capability and the ability to move through territories that other armies couldn't (either because it was desolate or in seasons when the crops weren't ripe).
Not a specialist in this field, but:
More specifically, what made the Legion structure work so well?