Since this is a science board we'll use scientific definitions. The definitions used by cooks are not the same and are not even always consistent. A seed is the reproductive tissue grown by angiosperms (flowering plants), which was the evolutionary advance that allowed them to become the dominant type of plant on earth. A nut is one type of seed, which Sam has already described.
My husband eats alot of peanuts (which I know aren't really nuts) and sunflower seeds. I like cashew, pistashio, and macadamia nuts. But are these nuts or seeds?
I think Sam or someone else has also answered this question.
Peanuts are legumes (beans). From a nutritional standpoint the main difference between a nut and a bean is that nuts can generally be eaten raw and beans generally cannot. Nuts were a staple in the early Paleolithic diet before cooking was invented. Almonds are also not nuts. The almond tree is a species of
Prunus, the genus that also includes the cherry, apricot, peach, plum, nectarine, etc. Note that an almond in the shell looks very much like a peach pit, and note that if you crack open a peach pit there is a seed inside that could be mistaken for an almond but is bitter and poisonous to humans.
So a fruit that grows on a vine is a "gourd"? Are watermelons, canteloupes etc gourds? What is the difference (if any) between a gourd and a squash?
The cucumber family, with seven genera, is one of the most wildly successful families of angiosperms. One of its genera is the begonias, which with 1,500 species is one of the ten largest genera of angiosperms.
Gourds are one genus of plants in the cucumber family. Their fruits have sturdy shells that can be dried and used as tools, containers, musical instruments, etc. Another genus of the cucumber family includes the melons, whose fruits also have an inedible shell but it's not so sturdy. Squash are from yet another cucumber genus. In addition to the fruits we generally refer to in the kitchen as "squash," they also include the zucchini and the pumpkin.
Squash were probably the first cultivated plants in Mesoamerica, marking the dawn of the Neolithic Era with permanent agricultural settlements. In the Middle East it was the fig, and in South America it appears to have been the pepper. Grains, which we think of as the world's food supply, came much later. Their nutritional value is not obvious since they require cooking before they're digestible.
I am begining to suspect there is not regularity to all these names - just tradition. If there is, it would be nice to see a "family tree" with the categories as sub branches.
Foods were named long before biology was a science and the Linnaean system of taxonomy was established. So the familiar names of animals and plants often have no logic in terms of their scientific classification.