On Friday, seated beside President Barack Obama and speaking from a trailer at the airport, Prime Minister Benjamin Netanyahu at last mouthed the word “apology” when speaking to his Turkish counterpart, and Prime Minister Recep Tayyip Erdogan, despite the limpness of the language that followed – some distance from his initial demands – accepted the apology and agreed to normalize ties.

Why now, nearly three years after Israeli naval commandos boarded a Turkish ship in the small hours of the night and, greeted with violence and fearing their lives were in danger, opened fire and killed nine Turkish nationals? Why now, some 18 months after the UN report on the raid was released and Erdogan expelled the Israeli ambassador from Ankara?

The most immediate reason, the one most comfortable for all to discuss, is Syria.

The country is falling apart and its neighbors to the north and southwest have a shared interest in preventing chaos next door.

“The possibility that Israel and Turkey will put together a joint military task force to prevent the spread of chemical weapons within Syria is one that cannot be ruled out,” Yaakov Amidror, Israel’s national security adviser, told Army Radio Sunday.

He said such a possibility was still far off but that, as Syria disintegrated, and as Islamist elements seized control of key territories, it was in Israel’s advantage to ensure that Turkey not exercise its veto against Israeli cooperation with NATO. “As soon as the relationship with Turkey is restored, it will lose its desire to harm Israel’s ties with NATO,” Amidror said earlier to Channel 2 News.

Turkey’s own regional aspirations and those of Erdogan were also a factor.

On a personal level, Erdogan needs stability. His term in office ends in 2014 and the constitution, in its current form, bars him from running for re-election. He seeks to amend the law to create a presidential regime with extended power.

“Erdogan wants something like the (Hugo) Chavez model,” said Dr. Ely Karmon, a senior research fellow at Herzliya’s International Institute for Counter-Terrorism.

That aspiration, Karmon said, was what sparked talks with the PKK, a Kurdish organization whose jailed leader, Abdullah Ocalan, called for a historic ceasefire last week. And it was one of the reasons why Erdogan accepted an offer from Israel that has been on the table for some time: “He wants quiet.”

On the international level, Foreign Minister Ahmet Davutoglu’s doctrine of neo-Ottomanism has run into the wall. Hoping to ride the wave of anti-Israel sentiment to supremacy in the Arab world, Erdogan found that his comments equating Zionism with fascism earned a stern rebuke from Secretary of State John Kerry and little traction in the turbulent Arab world. Despite Turkey’s championing of Hamas, it had no hand in brokering the ceasefire between Israel and Hamas in November. The Egyptians, in the driver’s seat, did not even let Erdogan visit the Gaza Strip.

Jordan’s King Abdullah is apparently also not a fan of the neo-Ottoman agenda. He recently told The Atlantic’s Jeffrey Goldberg that Erdogan views democracy as a bus ride. “Once I get to my stop, I’m getting off,” the Hashemite king quoted Erdogan as saying.

Economically, too,Turkey has every reason to mend its ties with Israel. Bilateral trade between the two countries reached $4 billion in 2011, with a clear export surplus for Turkey. That fact, combined with the sanctions against Iran, the Stratfor intelligence group wrote in 2012, means that Turkey can’t afford to turn its back on Israel – one of the few growing economies in the region and the only stable state other than Turkey itself.

But above and beyond those considerations lies Iran.

Barely mentioned, but unarguable, is the fact that Turkey plays a pivotal role in Israel’s air defenses against the Islamic Republic. A NATO radar base in eastern Turkey, established in 2011 and manned by US soldiers, can relay critical intelligence back to Israel. “They (the Turks) have always claimed that Israel is not part of the system,” said Karmon, “but the Arrow, Israel’s defense against Iranian Shahab 3 missiles, is reliant on it.”

Turkey’s main opposition leader amplified this statement in November.  Sniping at Erdogan and his wrathful rhetoric against Israel, Kemal Kilicdaroglu noted that if Erdogan truly sought to extract a price from the Jewish state, he would suspend the radar activity in Kurecik.

“Why was the radar station in Kurecik [in the eastern province of Malatya] established? It’s because of Israel’s security,” Hurriyet Daily News quoted Kilicdaroglu saying. “Mr. Erdogan, you are appealing to the Arab League and United Nations to take action for Gaza: Then do it yourself and be an example to the world.”

For Israel that sort of measure would have grave implications. Tellingly, Erdogan, for all his relentless criticism of Israel, never took it.

Why not? Because Sunni Islamic Turkey does not want to see neighboring Shiite Iran armed with the bomb. It wants to lead the Middle East, not have the ayatollahs doing so.

Turkey may be riding the democracy bus to a dictatorship. It may be advocating for a pale shade of Islamism. But when forced to take sides, between reviled Israel, the US and the West on one hand, and an Iranian Shiite bomb on the other, Ankara seems to have made its choice.

With some prodding from Washington, and a bit of a climbdown from Jerusalem, Erdogan took a reluctant step in the direction of Obama and his new “friend Bibi.”