When someone spills the beans, they tell a secret to others. We use it when we want someone to tell us a secret but it can also be used when we are speaking about a someone who had a big mouth and told a secret. Remember that when you spill something, you let it out by accident. There is no official explanation for the beans as of yet. They often hypothesis that it stems from the bean count for secret elections in Ancient Greece but this has not been proven. If the imagery helps you remember, more power to you!
Here are a few examples in context:
LEM…xo!