“I interviewed a lot of collaborators, and they have a kind of inferiority complex,” Mr. Cohen explained. “They see the West, Israel, as much better than the Arab. I hear expressions like, ‘We’re worth nothing.’ Sometimes it comes from there, and sometimes it’s part of what the Israeli officers put in their minds.”

Collaboration has underpinned Israeli-Palestinian relations since before there was a modern state of Israel, dating back at least to the Jewish underground that operated during the British Mandate era in the 1930s. The Oslo Accords signed by Israeli and Palestinian negotiators in 1994 even made two villages — one in Gaza, one in the West Bank — safe refuges for about 1,500 Bedouins suspected of spying.

The very definition of collaboration has expanded in recent years. Some in Hamas and more militant groups consider the Palestinian Authority to be aiding the enemy when it coordinates security services in the West Bank with Israel. Since Hamas took control of Gaza in 2007 after winning elections, members of the rival Fatah faction who live here have almost universally been under suspicion. Selling land to Jews can be punishable by death.

But while experts on both sides estimated that 1,000 suspected collaborators were killed — mostly in summary justice — between 1987, the start of the first Palestinian intifada, and 1994, human rights groups have documented a relative handful of cases since. Of 106 death sentences imposed by the Palestinian Authority and Hamas-run courts since 1995, according to B’tselem, a leading Israeli human rights organization, 40 were for collaboration; through September, six of those collaborators had been executed.

Last month’s extrajudicial killings — all seven men had been tried and convicted, but several, including Mr. Shalouf, had appeals pending — were an echo of the public execution of at least a dozen collaborators who escaped from Hamas jails bombed during Israel’s last offensive in Gaza, the 2008-9 Operation Cast Lead. But they were a stark departure from Hamas’s efforts since then to pursue collaborators in court and not the street, spotlighting its dilemma as a movement rooted in militant resistance now trying to run a government.

The Qassam Brigades, Hamas’s military arm, claimed responsibility for the killings, but some party leaders condemned them. Issam Younis, director of Al Mezan Center for Human Rights in Gaza, said he met on Thursday with the Hamas justice minister and was convinced that the executions were being investigated and that their perpetrators would be punished.