During the 2nd century BC, the Roman Republic attempted to defeat the Numidians, a tribal population inhabiting a desertic area of North-Western Africa. Surely, the Numidian fighters were no match for the mighty Roman armies, yet the Numidian kings held on their own for decades. It was only in 105 BC that their last king, Jugurtha, was definitively defeated by the Romans.
The ups and downs of the Numidian wars left the Romans perplexed. How could it be that those unrefined Barbarians could keep at bay the Romans for so long? The opinion of the historian Sallustius was that the Numidians had used corruption to buy the Roman commanders. Sallustius reports that Jugurtha himself said about Rome, "Venal city! You would sell yourself if a buyer were to appear!".
Sallustius' interpretation is believable, even though it is not substantiated by historical data. Corruption is an unavoidable side effect of money and Rome was the most monetarized society of antiquity. The Romans had built their prosperity on the precious metal mines of Northern Spain and used their wealth to pay the large armies that they used to dominate the Mediterranean Region. But money is a double-edged weapon: it can be used to pay soldiers to fight, but also not to fight, or to fight someone they were not supposed to fight.
Once corruption has infiltrated society, money becomes everything, and the rule of the game, at all levels, becomes enriching oneself. But what role did corruption play in the war, exactly? Sallustius diplomatically faults King Jugurtha, but the Numidian economy was small, the Numidians were mostly poor shepherds. Where would Jugurtha find the money needed to buy the rich Roman leaders?
More likely, the Roman Army bought itself off. Setting up a military expedition implies a lot of money being spent at various levels for supplies, weapons, salaries, transportation, etc. And, at all levels, there are chances for bribery. Once the mechanism started, nobody in Rome really wanted Jugurtha defeated. As long as he was alive and fighting, there was money to be made. That's the likely reason why the war dragged for so long.
On their side, the Numidians were not so badly affected by corruption simply because they were a tribal society. In this kind of society, interpersonal relations are governed by honor, revenge, fealty, and the like -- NOT by money. Trying to corrupt a tribal warlord is not easy: for one thing, where could he spend the money? Besides, a corrupt leader is always at risk of revenge from his own followers. The end result was that the Numidian fighters were fewer in number not as efficient as the Roman legionnaires, but more trustworthy and surely cheaper.
The Roman surely realized what the problem was. But fighting corruption is always a difficult task, if nothing else because those who are supposed to fight it can be corrupted as well. So, how to solve the problem? There was an interesting trick that could be played. Powerful warlords were among the most corrupt of the corrupted, but with a twist. Whereas petty leaders profited from an ongoing war, rather than from a victory, the top commanders needed victories to gain prestige and money. So, they were efficient war leaders. The solution, then, was to give all the power to a warlord.
That was already happening at the time of Gaius Marius, with the Roman Republic in a "pre-imperial" condition. In about one century, Rome would be turned into a full-fledged imperial state, ruled by a single, all-powerful emperor. Of course, the emperor could not be corrupted: he already had everything.
Emperors could keep the empire together, at least as long as there were the resources for doing so. Then, with the exhaustion of the precious metal mines, the Roman state ceased to be a monetarized society. No more money, no more corruption. No corruption, no need for an emperor. And not even for a state. That's how history moves.
Fast forward to our times, and we can compare the US campaign in Afghanistan with the Roman campaign in Numidia. With all their might, the Romans and the Americans were hampered by the enormous costs of their military apparatuses, in both cases amplified by corruption at all levels. In comparison, the Numidians and the Taliban fighters were much less expensive.
It is true that the Romans did better than the Americans and eventually succeeded at subduing the Numidians. But think of just one thing: nowadays the descendants of the Berbers who fought the Romans in Numidia are still there, and still call themselves "Berbers." (more exactly ⵉⵎⴰⵣⵉⵖⵏ, ⵎⵣⵗⵏ, Imaziɣen) And where has the Roman Empire gone? Alas...
Note also that to estimate the degree of corruption of the Roman society we need to rely on qualitative reports. But for the degree of corruption of our society, we have more data, even though uncertain: look at this image (source).