Robert H. Scales, a retired Army major general, is a former commandant of the U.S. Army War College. Douglas A. Ollivant is a fellow at the New America Foundation’s Future of War project.

Military transformations can be hard to detect. They generally occur over decades, sometimes over generations. Soldiers are usually the first to recognize them, but for the perceptive, the signs of a sea change developing on today’s battlefields are there. Look carefully at media images of ground fighting across the Middle East, and you will notice that the bad guys are fighting differently than they have in the past.

In the immediate aftermath of the attacks of Sept. 11, 2001, the West confronted terrorists who acted like, well, terrorists. In Iraq and Afghanistan, al-Qaeda and other militant groups relied on ambushes, roadside bombings, sniper fire and the occasional “fire and run” mortar or rocket attack to inflict casualties on U.S. forces.

When terrorists were stupid enough to come out of the shadows, they fought as a mob of individuals. One rip of a Kalashnikov or a single launch of a rocket-propelled grenade was enough. If they stood to reload, they risked annihilation at the hands of their disciplined, well-trained and heavily armed American opponents.

Today, it’s different. We see Islamist fighters becoming skilled soldiers. The thrust of the Islamic State down the Euphrates River illustrates a style of warfare that melds old and new. U.S. soldiers fighting in Iraq used to say: “Thank God they can’t shoot.” Well, now they can. They maneuver in reasonably disciplined formations, often aboard pickup trucks and captured Iraqi Humvees. They employ mortars and rockets in deadly barrages. To be sure, parts of the old terrorist playbook remain: They butcher and execute prisoners to make unambiguously clear the terrible consequences of resistance. They continue to display an eager willingness for death and the media savvy of the “propaganda of the deed.”

We see these newly formed pseudo-armies emerging across the Levant as well. The Darwinian process of wartime immersion has forced them to either get better or die.

Some observers of the transformation admit that Hezbollah now is among the most skilled light infantry on the planet. And now there is Hamas. Gone are the loose and fleeting groups of fighters seen during Operation Cast Lead in 2008. In Gaza they have been fighting in well-organized, tightly bound teams under the authority of connected, well-informed commanders. Units stand and fight from building hideouts and tunnel entrances. They wait for the Israelis to pass by before ambushing them from the rear. Like Hezbollah and the Islamic State, they are getting good with second-generation weapons such as the Russian RPG-29 and, according to as-yet-unconfirmed reports from the fighting in Gaza, wire-guided anti-tank missiles.

These fighters are now well-armed, well-trained and well-led and are often flush with cash to buy or bribe their way out of difficulties. While the story of the disintegration of the Iraqi army is multi-causal, the fact that it was never trained to face such an opponent as competent as the Islamic State was certainly a factor.

This frightening new age is emerging due to several factors that neither the United States nor Israeli forces anticipated. First is the influence of foreign fighters. Iranian advisers throughout the Middle East are getting better at their craft. Radicalized fighters from the Chechen and Bosnian conflicts serve Islamic State forces as mentors. The terrorists of the last decade generated one-shot suicide bombers of little strategic consequence. Now they have learned to build fighting units and teach weapons and tactics very well.

Second, the bloody Syrian war has served as a first-rate training ground for the Islamic State and Hezbollah. The crucible of that terrible war permitted them to forge leaders, practice tactics, train to maneuver on the urban battlefield and build political and military institutions with mass and resiliency. Perversely, having these two Islamist organizations in conflict with each other has made each one stronger, not weaker.

Third, these new armies talk to each other, even occasionally across ethno-sectarian divisions. Social media and strategic intercessions in Syria, Lebanon, Gaza and Iraq have created a body of well-informed and battle-hardened leaders and soldiers who share lessons learned.

Fourth, while these new armies are becoming more professional, they retain the terrorist’s specialty of disciplined killing. Terrorist killing used to be mostly random. But now killings are often orchestrated, media-driven executions of surrendering soldiers and opposition leaders. Such strategic killing can give the armies a psychological advantage before the clash of arms begins.

What we see in Gaza, Syria and Iraq should serve as a cautionary tale for any Beltway guru calling for a return of U.S. forces to Iraq. U.S. soldiers and Marines are still the global gold standard, but their comparative advantage has diminished. As terrorist groups turn into armies, pairing their fanatical dedication with newly acquired tactical skills, renewed intervention might generate casualties on a new scale — as the Israelis have been painfully learning.