Four years ago, Syria’s president launched a crackdown on demonstrators protesting his authoritarian rule.

Today, the crisis in Syria has evolved into a proxy war involving Iran and the Gulf States, the U.S. and Russia, Sunni and Shi’ites.

In Syria, Fluid Loyalties Complicate US Efforts

It is being fought by a complex web of local actors whose interests alternately conflict and converge, complicating U.S. efforts to arm and train ‘moderate’ rebels in the battle against the Islamic State.

In Syria, Fluid Loyalties Complicate US Efforts

Nothing demonstrates the nature of the Syrian war better than events in Yarmouk, a two-square kilometer district of Damascus that before the war housed Syrians as well as 150,000 Palestinian refugees who, at least for the first year of the conflict, tried very hard to stay politically neutral.

In Syria, Fluid Loyalties Complicate US Efforts

But as the situation deteriorated, it became harder for them to maintain political distance.

In 2012, members of the loosely-knit opposition Free Syrian Army (FSA) entered the camp and with the aid of a Hamas-aligned Palestinian militia, Aknaf Bayt al-Maqdis, stole control of Yarmouk from the Popular Front for the Liberation of Palestine General Council, which supported Syrian President Bashar al-Assad.

Syria retaliated with bombs and in mid-2013 sealed off Yarmouk entirely. No food or medicine entered the district for months, and people resorted to eating grass and cacti to ward off starvation.

In October that year, reported that the situation was so dire that a Yarmouk imam giving residents permission to eat dogs, cats and donkeys.

Most recently, in early April, Islamic State fighters entered the distict and, with the , seized control of nearly all of Yarmouk.

After IS beheaded two Aknaf Bayt al-Maqdis leaders, the militia which had formerly opposed the Assad government now allied itself with the Syrian military in an attempt to defeat IS.

“Yarmouk is essentially a microcosm of the larger Syrian civil war,” said , a Senior Fellow at the and former U.S. Ambassador to Syria.

“The fight in Yarmouk was actually a three-way fight between the Islamic State on one side, armed opposition elements — including some Palestinians — on a second side, and on the third side, the regime with some Palestinians," he said. "It became an extremely confused battle.”

Syria's shifts in allegiance can be difficult for Westerners to understand.

“Since the beginning of the Syrian uprising in spring of 2011, we — the West — have looked at the Syrian conflict as a battle between ‘good guys’ and ‘bad guys’,” said Hamdi Rifai, a former New York Attorney who now heads an advocacy group called .

“I don’t think that the narrative is necessarily incorrect, that there are ‘good guys’ and that there are ‘bad guys’,” he said. “But I think that because we’ve made some very fundamental mistakes, we have essentially left the good guys no option but to partner with the ‘less bad’ guys for their own survival."

Syria has been reduced to what , director of the University of Oklahoma’s calls “a Darwinian jungle” in which hundreds of small militias have been absorbed into larger, more powerful ones.

“And they span the ideological spectrum from al-Qaida all the way to much more secular outfits that want democracy and are looking towards the West for help,” Landis said.

In the end, it’s all about survival, some analysts say.

“Often, this leaves groups to make different groups to make decisions about who they are and are not willing to cooperate with, who they are or are not willing to engage with, in their attempt to survive and to continue to pursue their priorities,” said , a fellow at the Institute for the Study of War.

“In the case of many Syrian rebels, that priority is action against the Assad regime, so they will make alliances depending on their ability to do so," she said. "Other elements of the opposition simply desire to protect their communities.”

In early January, for example, after a twenty-month blockade of Homs, embattled rebels in Al-Waar district agreed to a in order to secure food and other supplies for civilians under their control.

“And in the cases of other regime fighters, you will see them sometimes make local deals with actors that are actually fighting them or strategically against them,” Cafarella said.

Many wartime relationships are transactional in nature. IS, which now controls a number of oilfields in the northeast, earns two to three million dollars a day to the Syrian government, Turkey and the Kurds.

In December 2012, U.S. reporter Richard Engel and five members of his NBC news team were kidnapped in Syria. Engel his abductors were members of the Shi’ite shabiha militia working for the Assad government.