As a legume, the peanut belongs to the botanical family Fabaceae; this is also known as Leguminosae, and commonly known as the bean, or pea, family. Like most other legumes, peanuts harbor symbiotic nitrogen-fixing bacteria in root nodules. This capacity to fix nitrogen means peanuts require less nitrogen-containing fertilizer and also improve soil fertility, making them valuable in crop rotations.
Peanuts are similar in taste and nutritional profile to tree nuts, such as walnuts and almonds, and as a culinary nut are often served in similar ways in Western cuisines. The botanical definition of a “nut” is a fruit whose ovary wall becomes hard at maturity. Using this criterion, the peanut is not a typical nut.
Sources: https://en.wikipedia.org/wiki/Peanut