Though we refer to them as "nuts", peanuts do not grow on trees.
They are a legume, and grow in the ground. The difference between a nut and a legume is not always immediately obvious. Both legumes and nuts consist of a simple dry fruit carried inside a pod or shell, but upon examining the details, the two groups prove to have significant differences. Nuts are noted for having only a single seed in the shell, which is not attached, and they can be part of a number of different plant families.
Legumes, however, usually have multiple seeds within a casing, which are often attached to its inner wall.