The Islamic State leader Abu Bakr al-Baghdadi was able to hide out in an unlikely part of Syria, the base of a rival group, because he was paying protection money to its members, according to receipts for the payments recovered by researchers.

The receipts, typical of the Islamic State’s meticulous bookkeeping, showed that the group paid at least $67,000 to members of Hurras al Din, an unofficial affiliate of Al Qaeda and an enemy of the Islamic State.

While the rival group kept Mr. al-Baghdadi’s secret, he was ultimately betrayed by a close confidant, two American officials said Wednesday, leading to his death in an American Special Forces raid last weekend…

While the announcement of Mr. al-Baghdadi’s killing on Sunday took many by surprise, there were indications as far back as February that ISIS had not just penetrated its rival’s lair in Idlib Province, near the Turkish border, but was starting to use it as a refuge.