From Harold McGee’s On Food and Cooking:

“Unlike most edible fruits, the fruits of the bean family were not designed to appeal to seed-dispersing animals. This group of plants is often called the legumes….. Green beans are immature pods harvested before they begin to dry out.”