In the 14th century there were two pandemics. One was the Black Death, the other was the commercialisation of warfare. Mercenaries had always existed, but under Edward III they became the mainstay of the English army for the first 20 years of what became the Hundred Years war. Then, when Edward signed the treaty of Brétigny in 1360 and told his soldiers to stop fighting and go home, many of them didn't have any homes to go to. They were used to fighting, and that's how they made their money. So they simply formed themselves into freelance armies, aptly called "free companies", that proceeded around France pillaging, killing and raping.

One of these armies was called the Great Company. It totalled, according to one estimate, 16,000 soldiers, larger than any existing national army. Eventually it descended on the pope, in Avignon, and held him to ransom. The pope made the mistake of paying off the mercenaries with huge amounts of cash, which only encouraged them to carry on marauding. He also suggested that they move on into Italy, where his arch-enemies, the Visconti, ran Milan. This they did, under the banner of the Marquis of Monferrato, again subsidised by the pope.

The nightmare had begun. Huge armies of brigands rampaging through Europe was a disaster second only to the plague. It seemed as if the genie had been let out of the bottle and there was no way of putting him back in. Warfare had suddenly turned into a profitable business; the Italian city states became impoverished as taxpayers' money was used to buy off the free companies. And since those who made money out of the business of war naturally wished to go on making money out of it, warfare had no foreseeable end.

Wind forward 650 years or so. The US, under George W Bush, decided to privatise the invasion of Iraq by employing private "contractors" like the Blackwater company, now renamed Xe Services. In 2003 Blackwater won a $27m no-bid contract for guarding Paul Bremer, then head of the Coalition Provisional Authority. For protecting officials in conflict zones since 2004, the company has received more than $320m. And this year the Obama government contracted to pay Xe Services a quarter of a billion dollars for security work in Afghanistan. This is just one of many companies making its profits out of warfare.

In 2000 the Project for the New American Century published a report, Rebuilding America's Defenses, whose declared aim was to up the spending on defence from 3% to 3.5% or 3.8% of American gross domestic product. In fact it is now running at 4.7% of GDP. In the UK we spend about $57bn a year on defence, or 2.5% of GDP.

Just like the taxpayers of medieval Italian city-states, we are having our money siphoned off into the business of war. Any responsible company needs to make profits for its shareholders. In the 14th century the shareholders in the free companies were the soldiers themselves. If the company wasn't being employed by someone to make war on someone else, the shareholders had to forgo their dividends. So they looked around to create markets for themselves.

Sir John Hawkwood's White Company would offer its services to the pope or to the city of Florence. If either turned his offer down, Hawkwood would simply make an offer to their enemies. As Francis Stonor Saunders writes in her wonderful book, Hawkwood – Diabolical Englishman: "The value of the companies was the purely negative one of maintaining the balance of military power between the cities." Just like the cold war.

Two decades ago I picked up an in-house magazine for the arms industry. Its editorial was headed "Thank God For Saddam". It explained that, since the collapse of communism and end of the cold war, the order books of the arms industry had been empty. But now there was a new enemy, the industry could look forward to a bonanza. The invasion of Iraq was built around a lie: Saddam had no weapons of mass destruction, but the defence industry needed an enemy, and the politicians duly supplied one.

And now the same war drums, encouraged by the storming of the British embassy last week, are beating for an attack on Iran. Seymour Hersh writes in the New Yorker: "All of the low enriched uranium now known to be produced inside Iran is accounted for." The recent IAEA report which provoked such outcry against Iran's nuclear ambitions, he continues, contains nothing that proves that Iran is developing nuclear weapons.

In the 14th century it was the church that lived in symbiosis with the military. Nowadays it is the politicians. The US government spent a staggering $687bn on "defence" in 2010. Think what could be done with that money if it were put into hospitals, schools or to pay off foreclosed mortgages.

The retiring US president, Dwight D Eisenhower, famously took the opportunity of his farewell to the nation address in 1961 to warn his fellow countrymen of the danger in allowing too close a relationship between politicians and the defence industry.

"This conjunction of an immense military establishment and a large arms industry is new in the American experience," he said. "In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist." It exists. The genie is out of the bottle again.