What is the meaning of [Spill the beans]

You accidentally knock over a bowl of beans and they all spill out. Think of this image and you’ll remember that spill the beans means to accidentally or prematurely give out information that’s supposed to be kept secret.