No one in Israel is calling the agreement signed for Gilad Shalit’s freedom a good deal. On many levels it is terrible. Israel is releasing more than 1000 prisoners, several hundred of them hardened terrorists, for one soldier. For the first time, the Jewish state essentially acquiesced as a terrorist organization dictated the list of prisoners to be released, including several responsible for mass deaths of Israeli citizens, a notion that would once have been unthinkable. Israel may well have given its enemies incentive to kidnap more soldiers. And the terrorists now being released are likely to attack and kill Israelis in the future.

Despite these facts, the deal for Shalit passed a cabinet vote by an overwhelming margin (26 in favor and only three opposed), and the vast majority of Israeli citizens support it. In agreeing to this prisoner swap, Prime Minister Benjamin Netanyahu and the Israeli public chose to return to their roots, to revive a central tenet of old-time Israeli ideology: we do not leave our sons in the field.

The tenet is as old as the country itself. It stems from the fact that the Israel Defense Forces (IDF) is a citizens’ army, in which conscription is universal and every family knows that it could face the same tragedy as the Shalits. And in the army itself, the “stretcher march,” in which soldiers in training are ordered to carry one of their heaviest comrades on a stretcher up hills and down valleys for miles, is a formative ritual meant to instill one message: there is never a case in which soldiers cannot bring their wounded home.

This ethic is taught in other armies, too, but it resonates differently in Israel. From the moment of his capture, Gilad Shalit has been a household name. Compare this to the silence in the United States regarding Bowe Bergdahl, the U.S. soldier held hostage by the Taliban since June 2009. Ever since Shalit’s kidnapping, Israeli society has been wracked by a sense that it failed in its obligation to him.

Bringing Shalit home, the costs of the agreement with Hamas notwithstanding, is thus a fulfillment of an honored tradition. And it comes at a time when many of Israel’s old assumptions about its surroundings no longer hold. As the country struggles to navigate the economic and political upheavals in the Middle East and across the world, the agreement represents a return to Israel’s founding values -- an opportunity for politicians and citizens alike to reassure themselves that, in some ways, today’s Israel is still the same country in which many of them were raised.

The Shalit agreement was prompted by the Israeli security establishment’s realization that it could not rescue its captive soldier. The very incident in which Shalit was captured -- a cross-border Hamas raid from Gaza -- was an abject failure for the IDF. In the five years since the kidnapping, the same military that destroyed the Egyptian air force on the ground in June 1967 and that rescued over one hundred hostages from Entebbe, Uganda in 1976 continuously told the government that it had no means of freeing a soldier being held just beyond the border. Admittedly, over the past generation, Israel’s enemies have become far more sophisticated. But this deal, along with Israel’s lack of military options to address the Iranian nuclear threat, has left Israelis feeling an unfamiliar sense of weakness.

That unease has only been compounded by the tumult of the Arab Spring. Previously, when Israel enjoyed close relationships with Egypt and Jordan and quiet on its border with Syria, it could focus almost exclusively on the security threats posed by Hamas, Hezbollah, and Iran. But with the Muslim Brotherhood rising in Egypt, Bashar al-Assad’s regime slipping in Syria, and turmoil spreading in Jordan, Israel is operating in uncharted territory, and its people know it; the anxiety on the street is palpable.

Making matters worse, the Palestinian bid for statehood at the United Nations exposed the fact that Israel is more marginalized on the global stage than ever before. And Turkey, once a stalwart ally, has recently turned strongly against it. As it lost friends across the region and around the world, Jerusalem began to wonder whether it could successfully broker a Shalit deal without them. It decided to act while the political map remained familiar.

The Palestinian statehood initiative also upended the notion that while Hamas was a terrorist organization with which Israel could not negotiate, Fatah was the party that would eventually strike a deal. Since Israel’s invasion of Gaza in 2008, Hamas has been more or less quiet. Although there have been rocket attacks and a cross-border strike from Egypt that may have involved elements from Gaza, those incidents were quickly quelled by Hamas. Yet Palestinian President Mahmoud Abbas’ demand for statehood at the UN nearly dealt Israel a significant blow. Should he have achieved recognition, Abbas could have pushed for sanctions on Israel for occupying another member of the General Assembly and pursued claims against it in international courts.

Furthermore, in his speech before the UN General Assembly, Abbas left Israelis with little hope for peace. His refusal to recognize Israel as a Jewish state or to drop his demand for the right of return for Palestinian refugees into Israel proper made clear that the conflict is not about to be resolved. Israelis recognized that they would have to learn to live with this struggle, not dream of its resolution. For many, that means periodically swallowing agreements such as the swap for Shalit. To maintain the legitimacy needed to draft its sons into an army that may well be at war for generations, Israel’s government needed to show that it remains committed to bringing them home at any cost.

Israel’s predicament on the international front has been accompanied by social unrest at home. A summer of massive street protests across the country began because of grievances about the cost of housing but soon incorporated complaints about the rising prices of schooling, food, and raising children, as well as a myriad of other issues. The demonstrations accused Israel of abandoning social justice, another long-standing principle of Zionism. A strike by Israel’s doctors demanding more reasonable hours and increased pay still threatens to cripple the country’s public hospitals, to the point that the government has threatened to import foreign physicians. And thanks to the so-called price tag attacks -- acts of vengeance by extremist Israeli settlers on Palestinians and Arabs, including the burning of a mosque in northern Israel this past month -- racial tensions between Jews and Arabs have been on the rise, leaving Israelis disgusted and worried. All this social discord over the last several months has exposed fissures in a country that once prided itself on solidarity.

With Israel’s international standing crumbling and its internal cohesion fraying, Netanyahu, whose own political position was becoming tenuous, urgently needed to restore Israeli morale. He had to show that he could make tough decisions and shift the focus away from the country’s troubles to a foundational value that could reunite it. By striking the agreement to return Shalit, he succeeded. Netanyahu reminded the country of at least some of the core values that have always been critical to its ability to persevere -- values never more critical than now, as Israel’s enemies multiply and its social fabric decays.

Ironically, the cabinet voted for the Shalit agreement 25 years to the day after Israeli Air Force navigator Ron Arad was shot down over Lebanon, never to be seen again. Israelis decided not to re-enact that horrific affair, with the many false hopes of his return, and all of its desperation. They resolved to make a terrible deal, and a painful one, and in so doing recaptured just a bit of the Israel that once was, while they still could.