Back in the hunter and gatherer days, humans survived completely on what we could find/kill. This made our diet primarily Meat, Vegetables, Fruit and nuts. Food would spoil a few days after it was picked or killed, forcing us to spend all of our time looking for food. The winter months would be trying times as the plants died, animals were scarce and if your tribe couldn’t find food, your tribe died out.
Potatoes, Grains and legumes (peanuts, beans) could not be eaten by the paleolithic people because in their raw form they have so many toxins in them. Eventually, it was discovered that these foods could be ridden of enough toxins to make them edible, by merely heating them up. Note that this process does not remove all toxins, just enough to not kill you.
Read full article here