pull a rabbit out of a hat

Pull a rabbit out of a hat is the idiom used when you do something very surprising, such as magic trick acts where the magician pulls a rabbit out of a hat that looked otherwise empty. The idiom began as a literal term for pulling the rabbit out of a hat such as in a magic trick, but is now used as a figurative term for doing something very surprising and unexpected which others are often amazed by.