used as an interjectional expletive to express surprise, impatience, etc, generally combined with how, what, where, etc UK,1598 Euphemistic for “the devil”.
I don’t know how the dickens he managed to do it. He was a fellow of infinite resource. — Sir William Dargie, TheQuietMan, 1 April 2002
What the Dickens is going to happen, readers? And more to the point, who cares? — TheGuardian, 1 August 2003