As stated previously by Aidan Williamson:
An expression of great confusion, or bewilderment; A strong demand for answers; An emphasized version of "what is that?"
Used in the same way as "What the
Hell?" is used. Variations can be used,
e.g. "What in The Nine Hells is that thing?"
However, the origin is not, as he said, Forgotten Realms; it is an allusion made to
Dante's Infreno, from the Divine Comedy. In the Divine Comedy,
Hell is divided into nine circles, each one representing a different sin or crime.
The nine circles span from Limbo (for those who have committed no great sins, but are not admitted into
Heaven because they do not believe in God), to the ninth circle where Satan himself resides (a circle reserved for people who have been treasonous against
friends, family, and their nation.)