IT SEEMS that $25bn does not buy you much in the way of loyalty these days. That, give or take a few billion, is how much Saudi Arabia has pumped into Egypt since 2013, when Abdel-Fattah al-Sisi, then a general, toppled the country’s first democratically elected—and Islamist—president. The cash helped Egypt avoid an economic collapse. But lately it has shown little devotion to its benefactor. And the kingdom, in turn, has cut off its needy neighbour.

The principal cause of the rift is the war in Syria, which has upset a regional order that tends to divide along sectarian lines. Sunni powers, led by Saudi Arabia, have backed rebels trying to oust Bashar al-Assad, Syria’s blood-soaked dictator. Shia powers, such as Iran and Lebanon’s Hizbullah militia, back Mr Assad, who is Alawite (an offshoot of Shiism). So far, so predictable. But Egypt, which is mostly Sunni, has also quietly sided with the dictator.

That much was evident in October, when Iran’s foreign minister, Javad Zarif, lobbied to have Egypt join international talks over Syria in order to bolster the pro-Assad contingent. Days later Egypt voted for a UN Security Council resolution on the war offered by Russia, which also backs Mr Assad. The measure, criticised for failing to address Russian airstrikes in support of the dictator, did not pass. But Saudi Arabia’s envoy to the UN described Egypt’s vote as “painful”.

Saudi Arabia’s priority is to curb the influence of Iran, which it sees as a destabilising force. The kingdom has enlisted the help of Islamist rebels in Syria and Yemen, where it is fighting against the Iranian-backed Houthi clan. It has also allied with Turkey and Qatar, which are sympathetic to Islamist groups such as the Muslim Brotherhood. But those same Islamist groups are the top concern of Mr Sisi, now Egypt’s president, who deems them terrorist organisations. He booted the Brotherhood from office and sees Mr Assad as another bulwark against extremism and the disintegration of the state.

The quarrel between Egypt and Saudi Arabia comes as both countries face big economic challenges. Despite suffering from low oil prices, the kingdom sent $2bn to Egypt in September, helping it secure a loan from the IMF. But the Saudis also cut off shipments of cheap oil the following month, leaving Egypt scrambling to cover the shortfall. Whether it was a rebuke or mere frugality, the Saudis did not say. But Egyptian media figures slammed the kingdom for trying to put pressure on their government. “Egypt bows to no one but God,” said Mr Sisi, in response to the outcry.

There is a sense of wounded pride in Egypt, which once led the Arab world but is now beholden to the Gulf states. Many Egyptians think the rest of the region is still made up of “tribes with flags”, as an Egyptian diplomat once put it. A decision by Mr Sisi in April, later blocked by an Egyptian court, to transfer two Red Sea islands to Saudi Arabia was the cause of rare protests. The resentment is fuelled by the Egyptian media, which blames the kingdom for inspiring radical Islamists (including the Brotherhood). Most Saudis practice Wahhabism, an austere strand of Islam.

The disdain runs the other way, too. Many Gulf Arabs view Egypt’s leaders as hacks and wonder how they frittered away billions of dollars in aid. In October the head of the Organisation of Islamic Co-operation, Iyad bin Amin Madani, a Saudi, mocked Mr Sisi for claiming to have spent much of his life with only water in his refrigerator (an attempt to empathise with suffering Egyptians). After Egyptian complaints, Mr Madani resigned, citing health issues.

Saudi Arabia’s actions may be pushing Egypt into the hands of the kingdom’s rivals. After the fuel shipments were stopped, Egypt agreed to import oil from Iraq, which now has close ties to Iran. This is in keeping with Mr Sisi’s effort to diversify his country’s alliances after support from America, its most important backer, wavered following his coup. Donald Trump, America’s president-elect, now seems inclined to back Mr Sisi regardless of his dreadful human-rights record. Egypt has also moved closer to Russia, with which it held joint military exercises last month.

Periodic crises have afflicted the Egyptian-Saudi relationship for decades, so analysts warn not to make too much of the current spat. “Egypt needs Saudi Arabia’s largesse and Saudi Arabia—surrounded by enemies and unfriendly regimes in Iran, Syria, Iraq and Yemen—needs Egypt’s regional weight,” says Nael Shama, a Cairo-based political analyst. It is good, then, that neither seems to need the other’s affection.