There's generally been a long-standing division between two polities, one controlling the upper Nile (modern-day Sudan/South Sudan) and one controlling the lower Nile (modern-day Egypt), although note the boundary between the two of them has shifted over the millennia.
The Islamic caliphate conquered the lower Nile from the Byzantines in their initial expansion, but failed to make progress on the upper Nile, leading the region to remain Christian. The Ottomans eventually displaced the rump states of the caliphate as the rulers of Egypt, but made essentially no progress again pushing south into Sudan. However, the governor of Egypt eventually went on a campaign and actually managed to conquer Sudan and it held for a couple of decades later. But then Sudan had a successful rebellion against Egyptian rule, so the Egyptian governor asked the British (who had by that time invaded and colonized Egypt, even though it was still legally part of the Ottoman Empire) to help him reconquering Sudan. This was successful, leading to Sudan becoming effectively a British colony under nominal Egyptian (but not nominally Ottoman, unlike actual Egypt) sovereignty [1].
That's how Britain acquired Egypt and Sudan. By the time of the first treaty, of course, the Ottoman Empire was carved up for good and Egypt became a clear British protectorate and Sudan a clear joint-British/English condominium. That's why Britain was involved. One of Britain's goals in ruling Sudan was to prevent it from becoming an extension of the Egyptian state, and the first treaty was an instrument to that end (by requiring Sudan to provide Egypt with a reliable supply of water, it's less necessary for Egypt to actually physically control Sudan).
[1] Yes, trying to figure out the actual boundaries of the Ottoman Empire were in its last century of existence is an exercise in frustration.
Is it? I think you'll find similar "involvement" around the world. The Great Partition of Pakistan and India, and Pakistan and Bangladesh/East-Pakistan spring to mind.
The Middle East has indeed had very long periods of stability, and very often was significanrly more peaceful than Europe in all aspects including religious coexistence.