This week Saudi Arabia, the UAE, Bahrain and Egypt announced that they were again cutting diplomatic ties with Qatar. In a sharp escalation, they have also closed their borders to Qatari aircraft and ships, and the Gulf states have said that Qatari citizens in their countries must leave within two weeks. It is unclear how the standoff will be resolved, but the Saudis and their neighbours are making a clear play for western support, accusing Doha, Qatar’s capital, of backing terror groups including al-Qaida and Islamic State.

How did we get here? Before 2011, few in the west knew much about Qatar, the tiny Gulf Arab emirate whose main claim to fame was being the richest per-capita country in the world thanks to an abundance of gas and a paucity of people. But as unrest spread across the Middle East and leaders who had seemed to be immovable monoliths began to topple, an unlikely champion of the revolutionaries on the streets emerged: little Qatar and its Arabic and English-language news service, al-Jazeera.

Not everyone was pleased. The emirate had “too much money”, the Yemeni president Ali Abdullah Saleh said shortly before being deposed, and wanted to be a “big player” in the region. It had fomented a “conspiracy” against the Yemeni government to prove a point, he argued. Foreigners started to take note of the ambitious emirate, and for a while articles on its foreign policy and real estate dealings (Qatar owns billions of pounds’ worth of London property, including the Shard and Harrods) proliferated.

It was hard to know what to make of Qatar. Since 2011, Doha has backed rebel groups in Syria and Libya, but also provided troops to help to quell unrest in neighbouring Bahrain. The contradiction was typical of a country that has operated a scattershot, independent and at times maddeningly inconsistent foreign policy, doing its best to punch above its weight wherever it can.

Qatar hosts one of the biggest American military installations in the Middle East, a logistical and operational hub that was crucial to US operations in Iraq – operations of which al-Jazeera was and is a prominent critic. While maintaining relations with Washington, Doha has also managed to build bridges with Iran, develop ties with Hamas and Hezbollah – both designated terrorist organisations by the US – and, for good measure, attempted a thaw in relations with Israel.

Unsurprisingly, its approach to foreign policy has rubbed some of Qatar’s ostensible allies up the wrong way. “Qatar can’t be an American ally on Monday that sends money to Hamas on Tuesday,” John Kerry, then a US senator, said in 2009. Hacked emails from Hillary Clinton fingered Qatar as a clandestine sponsor of Isis “and other radical Sunni groups in the region”.

Qatar’s Gulf Arab neighbours are even less enamoured of the idiosyncratic course charted by Hamad bin Khalifa al-Thani, the emir who came to power in a bloodless coup in 1995. Hamad was seen as a maverick who undermined Gulf unity, and meddled in the affairs of neighbouring regimes. Gulf Arab leaders were hopeful that Hamad’s 2013 abdication in favour of his 33-year-old son Tamim would improve matters, particularly after the then Saudi king Abdullah bin Abdulaziz summoned the young emir to Saudi Arabia’s capital Riyadh and demanded pledges of loyalty. But by 2014, the Saudis were so infuriated by Tamim’s continued foreign adventurism that they, along with other regional allies, pulled their diplomats from Doha.

Although the diplomats eventually returned to their embassies, tensions were never properly resolved – hence the developments this week. The problem for western leaders is that the accusations being made against Qatar bring into focus a wider set of contradictions in their dealings with the Gulf states. Saudi Arabia has also been criticised, for example, for its support of hardline Islamist factions in Syria. A leaked Clinton memo named Riyadh as a sponsor of radical Sunni militias alongside Doha, and this week reports emerged that a UK government report had identified Saudi Arabia as a key sponsor of groups involved in radicalising young Britons.

Meanwhile the real issue for Riyadh and Abu Dhabi is not so much Doha’s backing for extremist groups as its relationship with the Muslim Brotherhood, its diplomatic ties with Iran and the critical tone al-Jazeera often takes towards other Gulf states. Saudi Arabia sees itself as the regional hegemon, and is sick and tired of Doha’s refusal to toe the line on foreign policy.

This leaves western policymakers in a tricky position. Qatar is a major investment destination for UK, US and French energy firms, who have ploughed billions of dollars into gas export facilities which, in turn, play an important role in European and American energy markets.

Doha is a huge investor in overseas markets, and has committed to spending £5bn in the UK in the run-up to Brexit. The US has 10,000 personnel at the al-Udeid airbase, and would struggle to find a new home for its troops and planes. Not inconsequentially, Doha is also meant to the host the World Cup in 2022. Western powers can’t just pick a side.

Barack Obama was troubled by the contradictions of the US’s relations with the Gulf states, which he saw as double-dealing “free riders”. His successor, Donald Trump, made a point of travelling to Saudi Arabia on his first foreign trip as part of a reset in relations with the Gulf monarchies – a move that may well have emboldened it to cut ties with Doha. Now, he will have to deal with a diplomatic crisis that threatens to lift the lid on the murkier side of that relationship.