They are legumes, in the same family as peas lentil and soy. We sometimes refer to peanuts as "ground nuts" because they grow in the ground. Real nuts, like walnuts, almonds, and pecans, grow in trees, so we can call them "tree nuts".
Peanuts physically resemble other legumes in shape and nutritional value (a great source of protein!). However, we use peanuts in food in much the same way that we use almonds and walnuts, so we just call them nuts.