Yes Taima is right! Imagine a bag and you don't know what's inside, and suddenly - a cat appears!
You have told somebody some information - perhaps a secret - and now the truth is out - 'the cat has been let out of the bag' - the cat's out of the bag! :)