Tens of thousands of Syrians have been caught in the crossfire as fighting has engulfed northeastern Syria. But many of the aid groups desperate to help the displaced and the vulnerable have been forced to flee.

On Tuesday, Doctors Without Borders announced that it was taking “the difficult decision to suspend the majority of its activities and evacuate all its international staff from northeast Syria.” The Paris-based medical emergency group cited the “extremely volatile situation” in the wake of Turkey’s invasion of northeastern Syria last week.

Mercy Corps, a Portland, Ore.-based nongovernmental organization operating in northeast Syria since 2014, announced the same Monday.

It is no doubt deeply distressing news for Syrians — but it’s not a surprise. Aid groups working in war-torn countries often have to flee just when help is most needed. And it’s not just bullets and bombs that these groups must contend with when trying to carry out their missions — though that’s a very real danger — but also government restrictions on who can work where and with whom, factors that can have big repercussions on the conflict itself.

While international humanitarian laws afford aid workers certain protections and privileges, the Syrian conflict, like that in Yemen, has followed few of these rules of engagements. Instead, aid organizations can find themselves caught between a pledge to protect and a reality in which political powers try to co-opt, restrict or attack their work.

Since Turkey’s incursion last week, an estimated 160,000 to 275,000 people have been displaced.

That’s one piece of a heartbreaking puzzle: the hundreds of thousands of Syrians killed and millions displaced since a 2011 uprising spiraled into a bloody civil and proxy war.

It can be hard to keep track of who’s fighting whom and who’s backed by whom in Syria, but civilians keep paying the highest price for the seemingly endless violence.

“I think Syria, by and large, has degraded humanitarian principles and humanitarian laws in a number of ways,” said Emma Beals, an independent Syria expert. International humanitarian law “has been thrown out the window. Attacking humanitarian workers and functions and structures” has been given a greenlight.

Before last week, humanitarian aid to northeastern Syria came either across the border from Iraq via NGOs in coordination with U.S.-backed Kurdish forces or via the United Nations in coordination with the Syrian government.

But the United Nations has faced criticisms for its far-too cozy relationship with Syrian President Bashar al-Assad’s government, which is accused of committing war crimes, including chemical attacks on civilians. The U.N. policy is to work with a country’s official representation — in this instance, the Syrian government. That means Assad’s regime gets to approve and control where aid goes and who gets it — and critics say he has manipulated humanitarian institutions to his benefit.

A recent report by New York-based Human Rights Watch said that “the Syrian government has developed a policy and legal framework that allows it to co-opt humanitarian assistance and reconstruction funding to fund its atrocities, advance its own interests, punish those perceived as opponents, and benefit those loyal to it.”

The U.N. World Food Program, for example, desperately needs funding because Syrians besieged by years of conflict are in dire need of assistance. But to get that aid, Syrians have had to move from rebel- to regime-controlled areas, one of many factors shaping the trajectory of the conflict.

To ensure that vulnerable people get access to supplies, aid workers have to comply with the conditions imposed by the government.

Syria, of course, is far from the only place where humanitarian principles and political realities conflict. Since 2014, a civil war has raged in Yemen between northern Shiite rebels, backed by Iran, and the internationally recognized government, backed by a coalition led by Saudi Arabia and the United Arab Emirates. Yemen, the Middle East’s poorest country, is facing what the United Nations has called the world’s worst humanitarian crisis.

The coalition, supported by the United States and armed with American weapons, has imposed a blockade on much of Yemen alongside bombing campaigns. As a result, 20 million impoverished and hungry people require emergency food assistance, according to the United Nations.

In August, the world body had to close some programs after countries never followed through on pledges of funding.

What does get in, however, comes with its own dangers. With so much of the country divided and inaccessible because of the fighting, it can be treacherous for humanitarian workers to arrange delivery of aid.

Like in Syria, the political restrictions and physical dangers in Yemen are heightened for local members of humanitarian groups, who often can’t simply leave like their more-protected foreign colleagues.

In Yemen, the countries supporting humanitarian workers are also often the same ones funding the fighting and destruction.

“The international community’s humanitarian policy also overlooks the inherent contradictions of donor countries militarily attacking Yemen’s infrastructure; effectively worsening the humanitarian crisis they attempt to address,” independent Yemeni journalist Afrah Nasser wrote last year, citing how Saudi Arabia, the UAE and allies such as the United States and Britain were among the top pledged donors to Yemen.