One of the most striking events in evolution was the appearance of the genus Homo around 2 to 3 million years ago. The first ancient humans, such as Homo habilis developed larger brains than their predecessors. This became especially apparent with the appearance of Homo erectus (upright humans) that spread from Africa throughout Europe and Asia until they became extinct around 400 to 500 thousand years ago. Related species included the Neanderthals and Denisovans, and eventually modern humans who first appeared in Africa about two to three hundred thousand years ago.
The dramatic increase in brain size in Homo has had a huge impact on the success of our species, and so there has been much interest in the reasons this evolved in our species as opposed to other species. One of the major thoughts was that the ability to walk upright allowed freedom for using the hands to make tools. Indeed, early Homo show evidence for the development of tools from stone and wood that allowed not only scavenging but the hunting of larger mammals. In this scenario the need for developing tools was a stimulus for brain development.
Another favorite hypothesis is the trade-off hypothesis. This is based on the fact that two organs that both need a lot of energy are the brain and the gut. The gut especially needs a lot of energy to breakdown plants, tubers and roots in which there is relatively little calories for the amount of food that has to be eaten. Early ancestors to humans had to have very large guts so that they could digest these plants, and much of the energy generated had to be used for digestion. Today one can see this in the gorilla who has an enormous gut to help eat these plant-based products.
With the advent of early Homo, the food shifted to more meats, and it is thought that this led to less energy needed to support digestion, with the trade-off that it could be used for brain development. Indeed, carnivorous animals tend to have smaller guts and bigger brains. The plant eating stegosaurus had a brain the size of a lemon, while Tyrannosaurus had the largest brain of all of the dinosaurs.
However, a bigger factor than shifting to protein-based diets was the introduction of fire. The earliest fire used for cooking was likely introduced by Homo erectus. The cooking of both plants and meats made it much easier to digest, so that reduced the energy needed by the gut and allowed brain size to develop.
The panda eats bamboo almost exclusively and so has a large gut. However, it was able to increase its brain size by decreasing its metabolism like the sloth. It is thus really important to assure good food intake during childhood to help maximize brain development and growth.