Following the announcement of a prisoner exchange deal between Israel and Hamas Tuesday night, Israeli television displayed a split screen showing crowds simultaneously dancing in both Jerusalem and Gaza City. One anchor on Channel 2 News commented, “It’s not often that you see people celebrating the same deal in Israel and Gaza.”

It would be wrong and skewed to suggest that the primary goal in reaching the prisoner exchange deal was driven by any motivation greater than the actual release of prisoners. But after five years of negotiations and amid the PA’s UN bid, the timing and alternative considerations involved are significant and potentially of great consequence.

As with everything in the Middle East, there is more to the prisoner exchange deal than what is immediately obvious. In the midst of Palestinian Authority President Mahmoud Abbas’s statehood bid in the United Nations, it is in the interest of both Israel and Hamas to undermine the PA president, something that was likely accomplished Tuesday.

Although Abbas’s bid for statehood is a bold move that excites Palestinians, most are aware that the diplomatic maneuver is unlikely to deliver any of the tangible results Palestinians demand, the least of which is technical statehood.

Up until today, Hamas has failed to actually improve the lives of Palestinians, both in the Gaza Strip and West Bank. Although its resistance ideology has preserved its credibility, electorates demand results from their governments.

Abbas on the other hand has delivered limited tangible results to Palestinians in the West Bank, most notably economic development. But by investing all of his political capital in seeking symbolic statehood in the United Nations, the Palestinian president has left himself vulnerable.

Palestinian civil society this week was in the middle of a growing popular movement in solidarity of a hunger strike undertaken by Palestinian prisoners in Israel. The issue is on the forefront of the Palestinian public consciousness.

It is in that context of both the prisoners’ strike and the PA statehood bid that Hamas’s now-proven ability to secure the release of 1,027 real Palestinian prisoners seriously threatens to undermine Abbas’s record of zero Palestinian states established.

But the timing of the prisoner exchange deal must also be viewed in an electoral context. In his speech officially announcing the deal Tuesday, Hamas leader Khaled Mashaal repeatedly said that the agreement was a victory for Palestinian unity.

Hamas and Abbas’s Fatah signed a reconciliation deal a number of months ago, promising to hold elections within a year, a deal that has not been implemented. By securing the release of prisoners from nearly every Palestinian faction, Hamas is in a much stronger position to stand in elections today.

Israeli Prime Minister Binyamin Netanyahu is also not oblivious to internal Palestinian politics. The Israeli government has expended just as much effort to oppose the PA statehood bid as Abbas has in recent months. While Netanyahu doesn’t want to embolden Hamas, he is likely happy to undermine the credibility of Abbas in order to weaken his resolve and the domestic support he received for launching the statehood bid.

The Israeli anchor commenting on the strangeness of Gazans and Israelis celebrating the same news was correct. Not since the late 1980s when Israel helped establish Hamas as a counterweight to Fatah have the two found themselves with such converging interests and goals.

If there is one person in the entire Middle East that was disappointed by news of the prisoner swap, it is Mahmoud Abbas.