The enemy was invisible. He was no nation, so we couldn't bomb him to defeat, as we used to do. He was no entity we could physically crush, as we used to do. He is no single person, so we couldn't assassinate him, as we used to. The enemy was an idea. And we killed him by leaving.
The hostile idea jumped from mind to mind, turning the infected against us. They were the elderly, the children and the allies. From everywhere we were under attack, and they said we should give up since the alternative would be razing villages and murdering hundreds, just to finally get one enemy. We refused to do this. We would not give up and yet we would leave. Our biggest weakness in this conflict was us. And we simply removed this weakness to become invincible.
The war stopped instantly. You can't fight an idea, but an idea can't fight an enemy that does not exist anymore. The partisans laid their ambushes, prepared their raids and plotted our demise. But we were gone. They waited in vain, they never got one of us. Yet they died in their thousands. And so we won the war by going away.
Imagine a war with one side absent. We, as humans, left but we sent our machines. We simply made science-fiction reality: Armed robots in the air and on the ground took our place and continued the fight. The enemy now faced a force that carried on, no matter what he threw at it. Once it sufficed to attack us now and then, lay some bombs for our vehicles and destroy something that we found important. We were frustrated. Now the enemy is: No matter what he did, the robots continued, as if they did not even care. When the enemy showed himself, he was killed with more precision than we ever could. Zero civilian casualties. One hundred percent kill rate, for those who still dared to resist.
Many objected to the use of fully autonomous robots in a war but the results soon ruled out most objections: Robots could think before shooting. Moreover they think fast and don't suffer from mental issues that disturb their perception. They never overreact in hectic situations and the single robot's expendability made it possible to prioritize the survival of local people - who don't really care for the war - over avoiding damage to the robots.
The civilian population soon realized that neither oppressive nor kind behaviour could be expected from the machines. They got used to them stoically constructing schools and bases while calmly fighting off what they recognized as enemies.
Most importantly, the enemy had no source of motivation anymore. Who was he fighting? If you shoot a robot, you produce scrap metal. You did not kill anybody of the opposing force. Nothing they did brought them any closer to something that could be considered as victory. We took the possibility of success away. What was the point of fighting now?
We ended this war forever.