What is the literal meaning of "let the cat out of the bag"? Why would someone put their cat in a bag? What did the cat ever do to them?
Evidently, only a shyster puts a cat in a bag – honest business people put in piglets.
The Phrase Finder (a handy resource for learning about the origin of idioms) says:
One [suggested origin] relates to the fraud of substituting a cat for a piglet at markets. If you let the cat out of the bag you disclosed the trick - and avoided buying a pig in a poke (bag). This form of trickery is long alluded to in the language and 'pigs in a poke' are recorded as early as 1530.
The same website also explains:
A poke is a sack or bag. It has a French origin as 'poque' and, like several other French words, its diminutive is formed by adding 'ette' or 'et' - hence 'pocket' began life with the meaning 'small bag'. A pig that's in a poke might turn out to be no pig at all. If a merchant tried to cheat by substituting a lower value animal, the trick could be uncovered by letting the cat out of the bag.
The Phrase Finder also list a second possible origin of cat (that of a cat o'nine tails), but it calls that theory the more dubious of the two.
Many phrases stick around long after their origins seem quaintly outdated. In fact, I'm looking forward to explaining to my grandchildren what “sounds like a broken record” means:
Back when I was your age – before there were iTunes cards, before there were CDs – we would walk to the record store, and buy our music on these big, black vinyl disks that we'd carry home under our arm. If we weren't careful with them, one might get a scratch, so when it was played on the turntable, it would “skip”, and play:
I'll never dance with an... I'll never dance with an... I'll never dance with an...
Let the cat out of the bag is an idiom.
to let the cat out of the bag
1. (idiomatic) To disclose a secret; to let a secret be known, often inadvertently.
It was going to be a surprise party until someone let the cat out of the bag.
Another similar idiom (also listed in that Wiktionary's page) is spill the beans.