This is really a question for r/anthropology, I think, as its prehistory.
Not really a question for /r/history - you'd have better luck asking in /r/evolution or maybe /r/anthropology. But here's a summary.
Evolution is a matter of happenstance, mutations that are essentially random being acted upon by the environment, which may favor, disfavor or be neutral towards them.
Generally, when a change happens that “sticks” around, the evolutionary reason is that it conferred a reproductive advantage. In other words, the “right” thing happened to the “right” species at the “right” time.
This is a very complex subject, so my explanation here is necessarily very cursory. But I’ll brief cover each of these aspects.
The “right” thing in this case is the development of a large brain as a survival strategy. Brains are very costly in terms of calories. Your brain is less than a fiftieth of your mass, but consumes almost a quarter of your daily calories. It must offer some huge advantage, otherwise it will never be selected. And since our brains didn’t suddenly go from chimp size to human size all in one step, it must offer an advantage at each step along the way, at every increment.
The “right” species in our case was a biped primate. This is essential for a couple reasons. One is that without prehensile hands, a large brain is severely handicapped. The way large brains work in our favor is by allowing us to build tools to enhance our activities, but building tools require hands capable of gripping with some dexterity. Another reason is because primate brains are very efficient, packing a lot of neurons into a very small space. A rodent brain with the same number of neurons as our brains would be several times larger, and we could never get enough food in the day to maintain it.
The “right” time was a period of rapid climate fluctuations. This caused frequent changes in vegetation, rainfall, ecosystems. Most species cannot evolve fast enough to cope with such rapid changes, but a large brain is capable of a wider range of behavior, allowing humans to adapt behaviorally rather than physiologically to the rapid changes.
All of these things happened to converge in Africa. Around 3-4 million years ago, there existed in Africa certain medium sized primates that were primarily arboreal, but climate change disrupted their habitats and forests turned to savannah. These critters, which had been occasional bipeds (like all apes) found a survival advantage in walking on two legs most of the time, rather than four legs. We don’t know why. Perhaps they were using crude tools even at this early stage, and it was simply in order to free the hands for them. Perhaps it was because standing on two legs is safer in tall grass and lets you spot predators more easily. Perhaps some other reason.
At any rate, bipedality preceded the growth of our brains, meaning that brains only grew because humans already had two free hands for tool use, so increased intelligence could immediately translate into better tools, improved hunting and foraging to increase the food supply and provide an immediate reward commensurate with the cost of the larger brain.
So the proximate “cause” or reason why humans developed in Africa is because hominids developed in Africa, so the right ape was present at the right time in the right place to reward increased behavioral complexity. But that’s not the ultimate cause, because you can always ask “well, why did hominids develop in Africa, why was this ape present there to begin with?” Or you could go back further and ask why did primates (who probably developed in Asia) spread to Africa? And so on.
Ultimately, it’s just the way evolution works. Mutations are largely random. Genetic drift is stochastic. The environment selects reproductively favorable mutations, but the environment itself is chaotic. Changes in volcanism, in the solar output of the sun, in periodic changes in earth’s orbit, in plate tectonics and continental drift, and a thousand other things produce the environments which do the selecting. So there is no ultimate reason for why everything came together in Africa 3 million years ago. If any of these factors had been different, it could have happened at some other place, or maybe nowhere at all.