From Arabian Assignment: Operations in Oman and the Yemen, by David Smiley. (The Extraordinary Life of Colonel David Smiley Book 2; Sapere Books, 2020), Kindle pp. 9-10:
Although Omani Dynasties have on occasion extended their territory as far afield as India and Zanzibar, Muscat itself has known a long succession of foreign overlords, from the Persians of Cyrus the Great to Albuquerque’s Portuguese — who behaved atrociously, lopping off limbs, ears and noses to punish or even to prevent resistance. These and other invaders — the hosts of the Prophet, the Caliphs of Baghdad, Turks and Tartars, Wahabis from beyond the Empty Quarter — have swarmed over the country. But although some of them ruled, for longer or shorter periods, over Muscat and the coastal belt, none of them established firm control behind the mountains, in Oman, where the tribes continued in their old way of life, intriguing and fighting among themselves in rancorous isolation from the outside world and deeply resentful of all intruders, Arab or nasrani [Christian].
They followed the Sharia law of Islam, rigorously interpreted according to the doctrines of the Ibadhi sect brought to Oman by the Kharejites [Seceders] — survivors from mutinous soldiers in the army of Ali, the Prophet’s son-in-law — and proclaimed at Nizwa at the end of the seventh century by Abdullah bin Ibadh. Ibadhis may not drink or even smoke, and must not trim their beards — though they sometimes trim their moustaches. Their puritan creed regards the Koran as the sole source of authority and teaches that it must be read literally, without interpretation; and, more important for the political history of Oman, their tradition requires that the choice of their Imam should be by election among the Faithful.
For nearly a thousand years, until the early seventeenth century, the Imams of Oman, who held both spiritual and temporal jurisdiction over their subjects, were elected on personal merit or popularity; any attempt by a reigning Imam to ensure the succession for his eldest son was fiercely resisted by the fanatical Ibadhi Qadhis — the judges who administered the law. But early on in the seventeenth century there arose a dynasty of Imams, the Al Yaarabah (or Yariba), who from their capital in the ancient fortress town of Rostaq established firm control over the interior of Oman. They not only expelled the Portuguese from Muscat, built up a powerful navy, and extended their influence throughout the Persian Gulf and even to East Africa, but such was their prestige that they were able to modify the elective principle and ensure that the succession to the Imamate continued in the direct line for nearly a hundred years. This last achievement was to have profound significance for the future.
After 1720 the al Yaarabah dynasty began to collapse in a series of disputes over the succession. There followed nearly twenty-five years of civil war, with two rival Imams fighting for supremacy, one supported by a confederation of tribes under the leadership of the Beni Ghafir — the Ghafiri faction — the other by a confederation under the Beni Hina — the Hinawis; these factions, whose rivalry has dominated most of the subsequent history of Oman, exist to this day and any Ruler, to be successful, must be able to control or hold the balance between them. The war ended with the victory of the Hinawi candidate, Ahmed bin Said, Governor of Sohar; this brave and energetic soldier expelled the Persians, who had taken advantage of the confusion to re-occupy Muscat, and founded the present ruling dynasty of Al bu Said.