(The). Rey de Habas, the child appointed to play the part of king on twelfth-night. In France it was at one time customary to hide a bean in a large cake, and he to whom the bean fell, when the cake was distributed, was for the nonce the bean king, to whom all the other guests showed playful reverence. The Greeks used beans for voting by ballot.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894