Nutrition
The peanut, like most plants, is autotrophic. This means that it is able to create its own food to support itself by way of photosynthesis. In photosynthesis, the plant takes carbon dioxide (CO2) from the air, water (H2O) from the ground, and energy from the sunlight to perform a chemical reaction that makes oxygen (O2) and glucose (C6H12O6).
In order to complete this chemical reaction, water is drawn up the tree through the xylem to the leaves, where photosynthesis takes place. The sugars created during photosynthesis are then transported down the plant from the leaves by way of the phloem. The phloem is primarily composed of sieve-tube members, companion cells, and phloem parenchyma. It is through the sieve-tube members that the nutrients travel. The sieve-tube members, which lack nuclei, are supported by their companion cells. Since the sieve-tube members already have a high concentration of glucose, water from the xylem diffuses into the phloem and the companion cells produce ATP to get the glucose across the barrier. Once the glucose enters the phloem, it travels down the plant, some being used to sustain the plant and some being stored in the seed to support the peanut's offspring.
Once the glucose is made, it is used by the plant for food and stored as peanuts as to provide energy for the new seeds. The part we eat is full of proteins and nutrients. These allow the new seeds to survive long enough for the new plant to break to ground surface and begin photosynthesizing for themselves. However, many of these seeds don't get the chance to grow into new peanut plants because they are harvested and sold as food.
Legumes, peanuts included, are significant nitrogen fixators. However, it's not really the peanut that does the nitrogen fixation, but the rhizobial bacteria it hosts. For more information on the peanut's relationship with these bacteria, please the interactions page.