Borders are negotiated boundaries between states. They are generally defined in one of two ways:
- by geological features that limit the projection of power of the
involved states, or...
- by treaty when such features do not exist but no state can establish
dominance in a region.
The former generally follow the contours of the land: rivers, mountain ranges, forests, etc. They basically represent how far a power can 'reach' by establishing trade and military access routes. The latter are often pencilled in on maps during diplomatic meetings, and tend to be straight lines without much regard for landforms.
Northern Africa was home to a few ancient states that helped define the geography of that region. Sub-Saharan Africa was largely defined by colonization, which means its political units often centered on coastal plains or rivers that provided easy access to inner resources. The major colonial powers established their regions of control using these 'natural' extents and creating straight (diplomatic) borders for the remainder of the territory. In Sub-Saharan Africa many of these artificial borders were erased or redefined as different states emerged in the post-colonial era, but in northern Africa — particularly across the Saharan expanse — these straight diplomatic borders have been retained, because it's not land that anyone wants to expend resources squabbling over.
See African Historical Atlas for a development of African borders