The last two postings of my diplomatic career, spanning the years 2006 to 2102, were to Israel and then to Saudi Arabia. Many of our friends wondered how my wife and I would cope with the transition, from – in popular headline terms – a vibrant democracy (at least within Green Line Israel) with a free press and Western-style chattering classes, to what is generally perceived as a distinctly undemocratic, secretive and over-religious autocratic society.

Neither of these summary portraits fits the reality of two very complex countries. And in any event there are some intriguing parallels between the two.

Both countries are based on holy (or unholy, depending on how you see it) alliances between church and state. The al-Saud dynasty was linked at its mid-18th century inception to 'Wahhabism' (although the Saudis themselves avoid the word, with its suggestion that their strict brand of Islam is no more than a sect rather than a return to the source), from which it derives the religious legitimacy on which it depends to retain its hold on power. Indeed, while Western commentators tend to see Saudi Arabia as an autocratic monarchy resisting liberal pressures to open up and democratise, the reality is that the current King has been a remarkable reformer, with the pace (slow, to Western eyes) of change determined not by worries about potentially revolutionary pressures from the left, but by concern not to run too far ahead of the religious conservatives on the right.

Zionism, however secular in its origins, was always empowered by the religious underpinning of the yearning to return to the Land – 'next year in Jerusalem', as the prayer goes at the conclusion of the Yom Kippur service and the Passover Seder.

That in part is why ideas such as a Jewish homeland in Uganda were never going to stick. And the shape of civil and even political life in Israel is determined by the 'status quo' deal David Ben-Gurion struck with the ultra-Orthodox at the time of the birth of Israel as a modern state.

Both countries are 'holy lands', with all the political complexities that entails. Israel is the more complicated of the two, since it is a holy land for Christians and Muslims, as well as for Jews. But even if King Abdullah has majored on the need for interfaith dialogue, it remains unthinkable, for example, that a green light would be given for the construction of a church on Saudi soil to meet the spiritual needs of Christian members of the country’s large expatriate community.

And both countries have complex internal religious fault-lines: In Israel’s case rigorously policed by the 'establishment' ultra-Orthodox community; and those between the Sunni majority and the Shia minority in Saudi Arabia. My head still rings with the number of times I heard secular Israelis complain bitterly about the unfair advantages enjoyed by the ultra-Orthodox in their midst, and developments in the country since my 2010 departure suggests this remains a sharply divisive issue.

Both Israel and Saudi Arabia share a common – intense – focus on Jerusalem. For Jews, the city is of course the main focus of the yearning to 'return', and many Israelis would argue that the Koran is distinctly lacking in references to Jerusalem compared to the key role it plays in their sacred texts. But for Saudis, while they take with enormous seriousness (but not always, some critics would say, with architectural taste) their role as the custodian of the holy places of Mecca and Medina, Jerusalem is the city to which Muslim prayers were originally directed, and was also the stopping point on the Prophet Mohammed’s Night Journey to heaven. What happens to the Old City and the Haram al-Sharif has been and will remain a key issue for the Saudis in any Israeli-Palestinian peace process, or other deliberation on the future of that small piece of sacred real estate.

Both Israeli Jews and Saudis – at least those from the central Nejd region – are chosen people, the former by the God of the Old Testament, the latter in their perception of themselves as the true inheritors of the Prophet’s vision and values. In both countries, this entails political complexity, with both societies finding it difficult to develop an adequate conceptual frame to cope with those not carrying such a definitional burden, and with modern ideas of universal human rights.

Flowing from the common conservatism of the two countries’ religious establishments is a common conservative attitude to women, although in Israel such attitudes are confirmed to specific minority communities and the overall position of women there is a quantum leap advance on the multitude of only gradually relaxing restrictions they face in Saudi Arabia. But to sit in a heavily-bearded all-male gathering of Saudi imams is to be reminded of similar meetings in Israel with equally heavily-bearded and equally all-male groups of leading rabbis.

There is something similarly obsessive in both countries in the constant focus on their relationship with the United States, and with the political scene in Washington. Although both Saudi Arabia and Israel are currently deeply frustrated with the recent regional behaviour of their key Western ally (its perceived simplistic approach to Egypt; the Syria 'blink'; and the risk of a limp US deal with Iran cutting the latter too much slack in the region), and might conclude that any 'security guarantee' in their favour is a thing of the past, they will also be aware that in the event of possible worst case scenarios – for instance, on the Saudi front, an Iranian attempt to close the Straits of Hormuz – there is a radical shortage of alternative states still likely and with the military capability to help them out.

There are some similarities too in the ambiguities which go with such bottom line dependence, given the deep-seated Israeli desire to be (or at least to appear to be) strong enough to look after their own security, and the political sensitivity in any Arab country about any kind of reliance on Uncle Sam, given inter alia the understandable perception of a long-standing lack of American even-handedness on the critical Palestinian agenda.

Both countries of course fear Iran, and worry about the consequences of a Tehran with the bomb. For Israel, this is clearly their number one existential threat. But Saudi fears of Iranian influence and regional trouble-making go deep, to the ancient split between the Arabs and the Persians, and of course to the Sunni/Shia divide. They see Iranian influence expanding and encircling them, in Iraq, Syria and Lebanon, and in countries such as Bahrain and Yemen. Syria is currently the main focus of this regional Great Game.

While however there are parallels, the differences too between the two countries are profound.

While the Saudi press is more vigorous than generally billed, its coverage of the internal political scene is tame when compared to the UK-style intensity of the harsh spotlight the Israeli media throw on their leaders, although there is a striking and increasing drumbeat of criticism and debate in Saudi social media. And however much Israel’s critics would shine a negative spotlight on issues such as the status of Israeli Arabs and the severe failings of Israel’s conduct in the Occupied Territories, there is a huge difference between Israel and Saudi Arabia when it comes to issues such as a Western understanding of the rule of law, or the structure of the economy.

Nor should the Israelis make too much of the similarity of their and Saudi interests on the Iranian front. This shared worry does not mean that the Saudis attach less importance than they say publicly to the plight of the Palestinians, even if the pressures of the Arab Spring in the region have inevitably pushed that issue down their immediate agenda. However mixed Saudi memories of Arafat are, the Palestinian cause remains a sacred one for them. Indeed, part of the reason the Saudis want to see progress on the Palestinian issue is to seek to deny the Iranians the ability to claim – with a politically calculating eye on the 'Arab street' – that they are the more genuine advocate of Palestinian rights.

Nor should the Israelis forget how deep suspicion of the Israeli agenda remains in Riyadh. Few if any Saudis believe that Netanyahu is serious about peace, and most see continuing settlement activities as further evidence of an underlying expansionist agenda which the Americans are unable or unwilling to check. This suspicion feeds into some wilder theorising: it is par for the course to hear it suggested at dinner parties in Riyadh that the Mossad is behind all the evils of the region, at least when the Iranians are not being similarly blamed, and it is distressing when otherwise reasonable Saudis insist there are still unanswered questions about who was really responsible for 9/11.

Nevertheless, one does hear praise too in Saudi circles of the educational and technological achievements of Israeli society, and at the end of the day the Saudis are deeply pragmatic, indeed perhaps more so than the Israelis. I think that what is now called the Arab Peace Initiative (API), launched by then Crown Prince – now King – Abdullah in 2002, always represented more than a tactical bid to win some points in Washington after 9/11, or a prescriptive and unrealistic insistence on a full Israeli withdrawal to the 1967 lines or on the right of return by Palestinian refugees including to pre-1967 Israel. Rather, it reflected a Saudi willingness to accept Israel in the region, on the back of a comprehensive, negotiated peace deal.

And I remain convinced that in the unlikely event that the current Kerry process is going to achieve anything, then the API – with some creative adjustments to reflect the current additional complexities of starting down any Syrian or Lebanese track – will be a crucial part of the overall architecture of peace.

That would indeed be a fitting expression of partnership between the two holy lands, however bleak the prospects for such a breakthrough currently look.

This article was originally published in Haaretz.