The English idiom “spill the beans” means “to divulge a secret.” People sometimes use this idiom to describe a situation in which someone deliberately and maliciously reveals a secret, and the idiom may be used to refer to an accidental revelation. The phrase is often used like “let the cat out of the bag,” another idiom which refers to releasing something which was previously hidden.
The origins of this idiom are rather interesting, for people who find themselves intrigued by word origins. According to folk etymology, the idiom is related to the system of voting used in Ancient Greece, in which people cast black and white beans or stones as secret ballots. Tipping over the jar or basket used to collect votes before the outcome was decided would have been a classic case of spilling the beans. Alas, although this explanation is rather charming, it is likely not correct.
Another case of folk etymology claims that the idiom refers to spilling beans while planting, causing a crop to grow irregularly. This explanation is even less likely, given that there is no clear connection between causing crops to grow erratically and releasing information which is supposed to be secret, unless the spilled beans are themselves meant to be secret, and the bean shoots give the secret away.
In fact, “spill the beans” first appeared in the United States in the early 20th century, suggesting that the idiom is of fairly recent origin, although “spill” in reference to letting something out dates to the 1500s. The beans in this idiom may just be filler, given the variants like “spill your guts” for telling secrets, or just “spill” for talking about confidential material; beans are a well-known item, and many people have spilled beans while cooking at some point in their lives, so the idiom creates a vivid image. This idiom is most commonly used in American English, reflecting its origins.
The phrase has entered the main stream so thoroughly that it pops up in a variety of places. It is often used as a folksy colloquialism in public interest stories, like profiles of small town policemen who are adept at getting suspects to spill the beans, and it is also utilized as a slangy familiarity in some television series. People may also use it in casual conversation, especially when they want to tease someone for spilling the beans about something which was meant to be a surprise.