Klieber's law says that the ratio between the masses of animals and their metabolic energy consumption are related by a power law. Specifically energy goes up by the power of 3/4 with mass. This means that an animal that is 16 times bigger than another animal will be able to use 8 times the energy of the other animal.
Note for the non-science people. The energy we consume is ordered energy which converts to disordered energy called heat, according to the law of conservation of energy. So as we use energy it converts to heat.
The law comes about because of the problem of transporting heat and oxygen and other nutrients through the body. So a body will not be able to dissipate more than that energy or transport enough oxygen, so the energy is limited. Since this law is related to heat dissipation, it applies to different classes of living organisms differently. It works as defined only for warm blooded animals (and birds), and there are slight deviations for warm blooded animals living in water. This a pretty fundamental law and the deviations are minor.
There are several kinds of tissues in the body. Normal or structural cells are the most frugal in their energy use. Special tissues have different energy requirements. The most expensive of them all are neurons or the brain cells. The other biggest energy sink is the digestive system. It basically separates humans and the rest.
The other constraint is food availability and success in feeding. Food can also be divided into several types. Meat provides a very important macro-nutrient, but is thermogenic so not a very efficient source of energy. Carbs are normally complex in nature, and require a lot of indirect digestion through the use of bacteria. There are some exceptions, fruits and honey which have sugars, which are easier to absorb directly. Fats is rare in nature, even the animals in nature have little fat, except females during gestation, or animals before entering hibernation.
The herbivores have the most complex digestive systems and the smallest brains, as they spend too much energy digesting the food. They actually don't even eat directly. They breed bacteria which feed on their food and they feed on the output of the bacteria. Lots of the produced bacteria get thrown out which is why it becomes very inefficient.
The obligate carnivores have the simplest of digestive systems, but they eat a lot of protein, which is very thermogenic. Almost 30% of the energy goes waste as heat. This is why they don't have much energy left to have a bigger brain.
Lastly are the omnivores. These are able to eat both animal and plant matter. But it depends on what type of food they eat. Note if protein is eaten separately it will be converted to glucose and produce lots of heat and if plants are eaten it will require lots of energy. Still they are midway and generally have a slight advantage in the brain department.
We should take a note of birds and sea mammals here. Birds are omnivores and eat seeds, insects, and in some cases large animals. Sea Mammals eat fish mostly, but they are in water which allows them to dissipate heat much more easily, which gives them a slight edge as per Klieber's law. Both can go higher on the scale to have a higher brain size. But birds cannot grow very big if they have to fly, and they also need to have large parts of brain dedicated to flying functions. Sea mammals are considered pretty intelligent. In fact Dolphin and Killer Whales are next to humans in intelligence.
So we have seen how an omnivore diet helps in supporting larger brain. Now coming to the specific case of Primates and evolution to human. The primate closest in intelligence to human is Chimpanzee, and is also closest to us in genetic distance. They are fruitarians and non-vegetarians. They actually hunt for other monkeys and animals for meat. The fruit is very easy to digest which allows less energy wasted on the gut bacteria, allowing brain to grow. And meat consumption allows for easy access to protein which is very low in fruits.
Proto-Humans also started off as tree dwellers eating fruit and meat. Then they developed the ability to break bones to get to the marrow part. The marrow is highly nutritious both in energy and nutrients. This was a critical development, and moved them to become scavengers, hunting for kills from the top predators. It also caused a jump in brain size, because of the extra energy from fat. They gave up living in trees and moved to grasslands.
Then about 1.8 million years ago, something changed. Proto-Humans (aka the homo-erectus) lost their gut. This is pretty significant, as it means that they stopped relying much on the highly fibrous plant matter. The most likely thing is that they learnt how to use fire to cook their food. Heat softens food and makes it more bio-available. This caused a very big change in the brain.
The last major change was around 200,000 years ago, when Homo Sapiens arose. The major change is likely that humans learnt how to obtain starches and sugars more easily. It could be the evolution of honeyguide which provided humans access to a lot of honey and simple sugars. Humans could have also started to selectively breed more starchy tubers and fruits.
What we learn from this evolutionary story, is that simpler foods are better for our brains, but it takes several generations for the brain to increase due to increase in energy. It also requires a lot of nutrients, unless the human body adapts to producing them from other more plentiful nutrients. In the short term the excess energy is only going to make us fat.