It should have come as no surprise that Egypt’s new president, Mohamed Morsi, made his first official foreign visit to Saudi Arabia. Morsi, a Muslim Brotherhood man, went to Arabia last month for both religious and political reasons: He prayed in Mecca, and then there was a formal summit in Jeddah with the Saudi monarch and his crown prince. There was nothing concealed—the summiteers announced that theirs would be an alliance of “moderate Sunni Islam.” There was no need to mention Iran and its tributaries, the embattled Syrian regime, and Hezbollah in Beirut: For Saudi Arabia, this is the most natural of alliances, a return to the time of Hosni Mubarak when the Saudi-Egyptian axis held sway.The two countries are entangled in a thick web of relationships. Some 700,000 Saudis maintain residence in Egypt, where they savor its relative social freedoms. And there is huge traffic the other way—2 million Egyptians live and work in Saudi Arabia, their remittances sustain untold numbers back home.It was no secret that the Saudis had been unsettled by the fall of Mubarak. They were convinced that the diplomacy of this White House had cast Mubarak adrift. The tumult in Tahrir Square—those 18 days of protest that forced Mubarak from power—was traumatic for the Saudis. Just across the Red Sea, there was a nation, 82-million strong, hitherto led by a plodding man, giving itself over to revolutionary enthusiasm. For the Saudis, this evoked the specter of that Arab Cold War of the 1960s that pitted Egypt under the fiery Gamal Abdul Nasser against the House of Saud. This had been the most dangerous of times: The passion of Egypt had divided the House of Saud itself as a group dubbed the “free princes,” headed by Prince Talal bin Abdulaziz, a son of the founder of the dynasty, went over to the Egyptian side. The rest of the House of Saud rode out the storm, rescued, if truth be told, by Egypt’s defeat in the Six Day War of 1967. Saudi Arabia was lucky for the peace offered it by Anwar al-Sadat and Hosni Mubarak. It was willing to pay precious coin to ward off Egypt’s furies.The tumult of the Arab Spring put the Saudi-Egyptian relationship again in the wind.The protesters in Cairo, and the broad liberal-secular movement that appeared, at first, to carry the day in Egypt, had no love for the Saudis. In the fashion of modern Egyptians, the protesters had explained the religious conservatism of many of their fellow citizens as a Wahabi virus, brought to the Nile Valley by the Egyptian migrants who had gone to Saudi Arabia for work and come back altered by the zealotry of the Saudi realm. There was a small measure of truth—but only that—in this view. Saudi Arabia’s wealth was a rebuke to the poverty of Egypt. To believers and the impressionable, Saudi Arabia’s wealth was a sign of divine favor for the desert monarchy and a repudiation of the compromises of a more worldly Egyptian culture.The Brotherhood, too, had its own tangled relationship with Saudi Arabia. There had been years of terror and persecution for the Brotherhood under Nasser’s regime in the 1950s and 1960s—and leading figures in that movement had sought sanctuary in Saudi Arabia. They took with them their skills as teachers and pedagogues and professionals. Saudi Arabia was short an educated class, and these Egyptians shaped the Saudi educational curriculum and befriended princes and religious preachers. That relationship was not easy—there was hidden snobbery among the Egyptians and some resentment on the part of the Saudi hosts. The Brotherhood would never give the House of Saud the gratitude and the support the Saudi rulers expected. And when the Brotherhood, in the first Gulf War of 1990-1991, cast its lot with Saddam Hussein, the House of Saud turned away from the Brotherhood. The military regime in Egypt proved a more reliable ally.But this historic moment has re-made the landscape in the region. Syria, under its Alawi rulers, has proven a big Saudi disappointment. Vast amounts of Saudi treasure had been poured into Syria to wean it away from Iran, to stabilize it. The Saudis had hopes that a deal could be struck with Bashar al-Assad. In 2009-2010 the Saudis had even acquiesced as the Syrians worked their way back into Lebanon in the aftermath of the Cedar Revolution of 2005. Clear-eyed pragmatists, the Saudis had accepted that Syrian influence in Lebanon could not be annulled, that American power was receding in the Levant, and so it was best to work with Assad and forgive his transgressions. Rafik Hariri, Saudi Arabia’s man in Lebanon, had been struck down by the Syrians in 2005, and that had been a bitter pill to swallow. But swallow it the Saudis did, in the interest of limiting Iran’s influence in Arab lands.The Syrian rebellion has torn asunder the fragile Saudi-Syrian entente. The barbarism and cruelty of the Syrian regime has unsettled the Saudis. The rebels’ protests, staged on Friday, the day of religious observance, had exposed and deepened the schism between mainstream Sunni cities in Syria and their Alawi tormentors. This was a civil war between Alawis and Sunnis, and the regime’s terrible doings were transmitted daily via YouTube to Sunni societies in the Gulf.The facile belief that there is no public opinion in the Saudi realm and that the rulers do what they wish is untrue. On sacred matters of the faith, the Saudi rulers stay close to the sentiments of their public, and of the religious class that shapes public opinion. The decision of Saudi Arabia to throw its support to the Syrian rebellion was at once a political necessity and a religious obligation. In the best of worlds, the Saudis would have preferred to have the United States by their side in the campaign against the Syrian regime. But it had proven futile to wait on the Obama Administration. It was the better part of wisdom to work with Turkey and bet on the Free Syrian Army and the forces of the opposition by providing arms and funds.The Saudis knew that the fight in Syria had become a proxy war with Iran. They understood Iran’s advantages on the ground, and they were cognizant of the role Hezbollah in Beirut and the Bekka Valley played in sustenance of the Assad tyranny. They were eager for all the help they could secure against Iran.In Egypt they would find a natural partner. Egypt had taken time out from the game of nations: It had a revolution to settle, a fight for the makeup of a new order. With the triumph of the Muslim Brotherhood in the presidential election, the Egyptians were ready to return to the regional contest. Egypt is in desperate need of Saudi money, employment opportunities for its vast population, and tourist revenues. The struggle against Iran is to be anchored in the needs of both countries. There is Sunni solidarity at work, but more important, cold reasons of statecraft. American influence in the Persian Gulf and the Fertile Crescent is at a low point, a sectarian Sunni-Shia war has wrecked the peace of the region. The Muslim Brotherhood in Cairo and the Saudi rulers know how to bury their differences in order to fight a Shiite enemy.In this alliance lies partial deliverance for Egypt from its heavy burdens. There is of course that older way—that volatile mix of anti-Americanism, authoritarianism, and escape from reason that wrecked the country and its place among the nations. The Egyptian state thus has a choice to make. It can take up anti-Zionism and jeopardize the peace with Israel secured for it by Anwar al-Sadat and maintained by Hosni Mubarak. Or it can awaken to the threat of Iran. An Egyptian alliance with Saudi Arabia is the beginning of wisdom—a necessary, though hardly sufficient, condition for Egypt finding a way out of its crippling past.***Like this article? Sign up for our Daily Digest to get Tablet Magazine’s new content in your inbox each morning.Fouad Ajami is a senior fellow at Stanford University’s Hoover Institution and the author of The Syrian Rebellion.