Manbij is a good place to understand the jigsaw puzzle of competing fiefdoms into which Syria is now divided and the reasons why the multiple wars that have torn the country apart will go on for several more years. A largely Arab city with a population of 300,000, it is situated east of Aleppo and west of the Euphrates river, but has been effectively controlled by the Kurds since they captured it from Isis after a long siege in 2016.

Turkey has been repeatedly threatening to attack Manbij to end the Kurdish presence, though the Kurds, for their part, say they are no longer in control but have handed over power to a local body called the Manbij Military Council. The Turks claim that this just means that the Kurds have changed their uniforms, but the council, which has about 5,000 fighters, acts in concert with US troops, so, if Turkish troops and the local militias they work with do advance, it will be at the risk of a shooting war with the US.

The Americans in Manbij are certainly very visible and this is presumably intentional. We saw a convoy of five armoured vehicles, the lead one carrying the Stars and Stripes, racing towards Manbij from the bridge across the Euphrates. Mohammed Abu Adel, the leader of the Military Council, says the US soldiers never go into the city “but are very active in the frontlines”.

After seven years of war, Syrians are used to living in a state of permanent crisis, so the prospect of a Turkish assault has had only a limited impact. Ibrahim Kaftan, the co-chairman of the executive council running the city, says that when Turkey invaded the nearby Kurdish enclave of Afrin on 20 January, “about 80 per cent of the people here thought the Turks were going to attack us, but now they are more optimistic”.

In the crosshairs of the Turkish army and its militia allies Manbij may be, but for all that it is a surprisingly bustling place. The streets are crowded and the shops are piled high with everything from oranges to wheelchairs. A few buildings have been reduced to heaps of rubble, blown up by US airstrikes targeting Isis during the siege of the city, but there is not the devastation that you see in the Kurdish city of Kobani on the other side of the Euphrates. The most striking sign of the Isis presence is a large cemetery in the centre of Manbij where its militants systematically smashed all the tombstones, which they saw as idolatrous.

Syria’s war: Manbij residents celebrate freedom from ISIL

Despite the Turkish threat, Manbij has become a boomtown thanks to the chronic political fragmentation and instability which has ruined most Syrians. A prosperous trading city on the main highway to the east of the country, it had no great advantage before 2011 when Syria was united. But today it has the unique benefit of standing at the entrance to the vast territories to the east of the Euphrates captured by the Kurdish People’s Protection Units (YPG) with US air support from Isis since 2015. “We are the only gateway for the Kurds,” says Kaftan, who explains that businessmen from Aleppo had poured into the city to profit from the trade with the 30 per cent of Syria now held by the Kurds.

The Syrian jigsaw puzzle is even more complicated than is portrayed by those neat maps shown on television in which different factions are shaded in contrasting colours. Groups that are fighting each other in one part of the country are fighting side by side in another. The country has the feel of medieval Italy in which every city and town had its own distinct politics, along with some powerful foreign sponsor.

One quickly gets used to living in a world of competing authorities. For instance, we left the de facto Kurdish capital at Qamishli early in the morning, but to get to the main highway we went down a winding country road. This is because we wanted to avoid the old link road which goes past Qamishli airport, still held by the forces of President Bashar al-Assad under a mutually beneficial agreement. Assad wants to retain a foothold in north-east Syria and the Kurds want to have the option of flying to Damascus, since otherwise they are isolated.

The problem for the Kurds in Syria is that they have been almost too successful militarily. Once a marginalised minority, they became the main ally of the US in defeating Isis over the last three years. The YPG are dedicated and experienced infantry, but what gave them their crushing advantage over Isis was that they could call in the devastating power of the US air force.

The development of a de facto Kurdish state enraged the Turks and the government in Damascus. To hold onto at least part of their gains, the Kurds need continuing US support, though Isis is defeated and this makes Washington’s long-term support uncertain. Probably, the US will stick with the Kurds because it would be ashamed, at least in the short term, to abandon them. Doing so too swiftly would also deter other potential US allies in the Middle East who might fear a similar fate.

Aleppo before the Syrian Civil War Show all 12 1 /12 Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War A man crosses a street in Aleppo, December 12, 2009 Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War A vendor sits inside an antique shop in al-Jdeideh neighbourhood, in the Old City of Aleppo, December 12, 2009 Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War A view shows part of Aleppo's historic citadel, overlooking Aleppo city, Syria Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War A view shows part of Aleppo's historic citadel, Syria Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War Visitors walk inside Aleppo's Umayyad mosque, Syria Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War People walk inside the Khan al-Shounah market, in the Old City of Aleppo, Syria Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War A man walks past shops in al-Jdeideh neighbourhood, in the Old City of Aleppo, Syria Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War People walk along an alley in al-Jdeideh neighbourhood, in the Old City of Aleppo, Syria Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War Visitors tour Aleppo's historic citadel, Syria December 11, 2009 Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War A general view shows the Old City of Aleppo as seen from Aleppo's historic citadel, Syria December 11, 2009 Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War People walk near Aleppo's Bab al-Faraj Clock Tower, Syria October 6, 2010 Reuters Aleppo before the Syrian Civil War Aleppo before the Syrian Civil War A man stands inside Aleppo's historic citadel, overlooking Aleppo city, Syria December 11, 2009 Reuters

What is interesting and perhaps ominous about Manbij is that control of this small city has become an issue that could see US and Turkish troops shooting at each other. The same pattern is visible in the rest of Syria where fierce local disputes, such as the attempt by the Syrian government to batter Eastern Ghouta into submission, turns into an international confrontation.

Yet the wars in Syria have now gone on for so long that they are almost impossible to end. A few issues have been decided: Assad is going to stay in power in Damascus, but his power is not going to extend to the whole country. Isis has been defeated, overwhelmed by the sheer number of its enemies. But Russia, US, Turkey and Iran have become so embroiled in Syria that they cannot afford to see their local allies and proxies destroyed.