It refers to a famous quiz game, I think on radio, maybe on TV as well, but dating back to 50's / 60's where a panel of celebs had to guess an invited guest's ocupation by asking, in turn, a total of twenty questions. In common with a lot of early radio / TV shows, it was so popular with the massive audience of the time, that its name has passed into common usage.
Andy - you've just described "What's my Line?", in which the panel limited to 10 questions. (I'm a bit hazy on whether they could keep asking questions until they got one wrong)
"Twenty Questions" was on the radio - a public version of the old parlour game.
The panelists had to work out a word or phrase by using only 20 questions in total. They would be told whether the answer was animal, vegetable, mineral or abstract. Asking how many words were on the card counted as one of the 20 questions
Gilbert Harding in the chair, with Anona Winn, Joy Adamson, Jack Train and Richard Dimbleby on the panel.
Norman Hackforth as the mystery voice.
I think that we now have the expression "What is this? Twenty questions?" as a reaction against too many questions being asked about something we don't want to discuss.