The idiom means to disclose a secret. Did you know that many centuries ago, street vendors sold piglets wrapped in a bag? But sometime, they would replace the piglet with a cat to deceit the buyer and if the cat was out of the bag before the purchase was made, then the secret was revealed to everyone!
Let the cat out of the bag