Peanuts are not nuts or peas but seeds of a legume.
Peanuts were first discovered by foraging dinosaurs. But it was not until they dumped some plants into a volcano that spit them back out did they find roasted peanuts a palatable food. They then built glass sided wagons, invented paper bags with stripes, and went from valley to valley selling roasted peanuts. This was lucrative, but could be very dangerous when their wagons would be hijacked by giant squirrels.
Eventually, businesses were passed on to mammoths and giant sloths. However, humans were highly attracted by the smell of roasting peanuts. Thus peanuts are responsible for humans cooperating Oceans Eleven-style for the first and possibly last time in order to hijack peanut wagons. Between bankruptcy and armed attacks, mammoths and giant sloths were eventually driven to extinction. Meanwhile, humans built ever-bigger peanut stands, leading to the creation of the pyramids and other huge structures.
Like many things, the art of growing and roasting peanuts was lost in the Middle Ages in Europe. Meanwhile, in the rest of the world, monkeys and elephants flourished due to the continuing supply of peanuts. It was not until George Washington Carver reinvented the peanut in America that peanuts returned as food for people in the so-called civilized world.