Even though Huck is helping the Wilkses expose the duke and king, he is wise enough to know that the townspeople are stupidly unpredictable, so, instead of taking his chances with the mob, he makes a bold bid for freedom. But that freedom is limited by the arrival of the duke and king, whose self-interestedness has come to metaphorically imprison Huck and Jim in a life of fraud and close scrapes.