Original: All American beans at that time were vine plants, "bush beans" having only been bred more recently. The cornstalks would work as a trellis for the beans, and the beans would provide much-needed nitrogen for the corn.
Simplified: Example for such beans are Coffee beans, Cocoa beans, and Vanilla beans.