That common old trope that " all the borders of the middle east were drawn by members of the house of lords in a drawing room, wearing smoking jackets, and drinking port", that gets frustratingly thrown around obviously is not the truth.
Just as in the Americas, many of the modern countries of South and Central America are based upon the Captaincies, Intendencies, and Viceroyalties of the Spanish Empire, surely many of those arbitrary lines on the maps of Africa and the Middle East, drawn by the colonial powers have some sort of historical or logical basis.
AskHistorian got an opinion on the general aspect of that. This does not answer the specific question about how it was done in detail.
/u/khosikulu :
One of the great myths of colonialism in Africa is that borders were totally arbitrary or universally intended to create conflict. This is simply not true as a blanket statement, beyond the fact of European ignorance of long standing ties across new boundaries, or the fact that a quasi national boundary is always artificial. The entire basis of European territorial and protectorate claims in Africa existed based on treaties supposedly obtained from local rulers, and they (especially the British) were weirdly scrupulous about trying to match the claim with the boundary. (See Hetslet's The Map of Africa by Treaty, 3 vols. )
The problem that was most common involved borders between colonial powers, and that's where horse trading and impossibly straight borders did occur and some states were split. But there is a mythology around the process. Colonialists were indeed really really bad at sussing out African conceptions of territoriality and arguably the simple act of imposing their border system was an act of self serving malfeasance, but they did try to build the colonial fiction on a foundation of claimed legitimacy to succession of "native title" (per Weaver, The Great Land Rush).
If you're interested further, A. I. Asiwaju coedited a volume entitled African Boundaries and his own Partitioned Africans, and in one of those volumes is a long essay entitled "It Didn't Happen at Berlin" (by Hargreaves?) that is a very interesting meditation on this point. I can give a fuller cite tomorrow when I'm with my books on campus, but it's Sunday now. Hertslet should be on Google Books, I think. My edition is 1908.
(edit: do not take any of the above as a suggestion that colonizers did not happily take advantage of divide and rule strategy, which was required to hold on to territories; African proxies like Buganda or colonial military levies were the best of all. But the creation of colonial borders themselves rarely depended on that point. Again, the boundaries were badly made and weird because they embody a translated idea that Africans themselves had considered much more contingent. And let's not even get into the question of how long it took them to figure out where on the ground those borders were... )
There are quite a few other threads. There is also an important aspect about the size of the continent.