Hamas began 2021 preparing for elections to the Palestinian Legislative Council. Today, it is engaged in a military standoff with Israel. The movement has approached both with unexpected gusto, but which of the two approaches best represents its soul?

Both do. There is an underlying coherence in Hamas’s approach. However, uncovering it leads us to examine the movement’s tactical flexibility and attempts to get in front of Palestinian public opinion. Hamas has succeeded in achieving both. Since 2007 it has been bottled up in Gaza, saddled with responsibility for governing the territory’s blockaded population, and has engaged in outbreaks of fighting with Israel, interrupted by tenuous ceasefires. This year has presented the movement with two opportunities to break with this situation—the elections and the current war with Israel.

Elections offered Hamas a limited but real opportunity to reemerge in the West Bank, where it has been suppressed by Israel and the Palestinian Authority, and to enter into Palestinian national structures—a reconvened parliament and the Palestine Liberation Organization. Hoping that it would control a very large bloc in a divided parliament, Hamas would have found itself a part of Palestinian decisionmaking and an actor that could no longer be contained or ignored. It had just elected a new leadership that was willing to make concessions to Palestinian President Mahmoud Abbas and Fatah in order to move toward elections and Palestinian reconciliation. When Abbas canceled the elections, fearful of the divisions within his own movement (on the supposed but unconvincing grounds that elections were being hampered in Jerusalem), Hamas was left with no seats. But it was also left with rivals whose divisions were now on display, and with a president who has little credibility and few options.

The political vacuum following the cancellation was followed by a profound crisis involving Jerusalem—one that deepened recent and distant Palestinian traumas. When Israel moved to evict Palestinian residents in the Sheikh Jarrah neighborhood, the effort seemed to echo the Nakba, the defeat and expulsion of the Palestinians in 1948 after Israel’s establishment. By enforcing an Israeli claim to all of the city, by reviving Jewish property claims that predated 1948 while continuing to violate Palestinian ones, Israel made the Nakba appear to be a continuing event rather than a historical memory.

Those moves also seemed to come at a moment of international abandonment of the Palestinians. The Trump administration had favored efforts by Israeli extremists to evacuate them from their homes and replace them in Jerusalem. The matter took on a religious coloration when Israeli measures restricted worshippers in the city during Ramadan and targeted those assembling at the city’s Al-Aqsa Mosque, a sacred place for Palestinians and Muslims around the world. The images of clashes within its compound—and widely viewed videos of the Israeli police’s intrusion into the mosque—only compound Palestinian resentment.

Hamas did not initiate or lead the waves of mobilization against the evictions. But the measures left the movement with the opportunity to step forward. Hamas’s leaders believe they will not be blamed for the heavy price that Gazans are now paying through Israeli attacks on residential areas and civilian deaths. Previous rounds of fighting were decided within this equation. The head of the Hamas Political Bureau, Ismail Haniyeh, explained that the war was not Hamas’s choice, but that the movement had been “invited to interfere” by Palestinians, before he called for a new Palestinian leadership.

The conflict has thus far claimed the lives of close to 200 Gazans, among them 58 children and 35 women, while eleven Israelis have died in rocket attacks. Hamas expanded the war by firing rockets at West Jerusalem as a reaction to Israeli police intrusion into the Al-Aqsa Mosque compound. Hamas has hoped to build on this to ease the siege against its rule in Gaza. The group is highly sensitive to its standing among the population, including the public’s examination of its actions and elections to its leadership.

The reelection of Yahya Sinwar in 2021 as the leader of the movement in Gaza, was a victory for a pragmatic approach toward elections and power-sharing. Hamas decided to participate in the legislative elections to help extricate the movement from its current predicament. Since its military takeover of Gaza in 2007, Hamas has repressed dissident voices. From the standpoint of many young people, its behavior has been seen as just as “corrupt” as Fatah’s rule. Nor does living under siege seem to be a viable form of resistance. The Israeli closure of Gaza has prevented Hamas from being able to deliver on its electoral and social programs and promises, undermining its position at the local level. Against this background, many Gazans see that Hamas’s project of combining both armed resistance and governing authority has largely failed.

However, the latest fighting has allowed Hamas to tell Gazans that their suffering has not been in vain. In speaking to people in Gaza through WhatsApp, we heard individuals who had criticized Hamas’s past military exchanges with Israel saying that they supported its actions today. In a speech last week, Haniyeh posed as “the defender” of the helpless people in Sheikh Jarrah and Al-Aqsa Mosque and as a representative of the Palestinian people. At least for now, the contrast with the ineffectual Fatah movement is apparent, allowing Hamas to claim that it offers a pathway to national unity.