Letting the cat out of the bag (also ...box) is a colloquialism that means to reveal facts previously hidden.
It could refer to revealing a conspiracy (friendly or not) to its target, letting an outsider into an inner circle of knowledge (e.g., explaining an in-joke), or the revelation of a plot twist in a movie or play.
One suggestion is that the phrase refers to the whip-like "cat o'nine tails", an instrument of punishment once used on Royal Navy vessels.
The instrument was purportedly stored in a red sack, and a sailor who revealed the transgressions of another would be "letting the cat out of the bag".
[1] Another suggested derivation is from the "pig in a poke" scam, where a customer buying a suckling pig in a sack would actually be sold a (less valuable) cat, and would not realize the deception until the bag was opened.