The introductory quote—"The quality of mercy is . . . twice blest; / It blesseth him that gives and him that takes: / 'Tis mightiest in the mightiest: it becomes / The throned monarch better than his crown"—is part of "The quality of mercy" speech from Shakespeare's The Merchant of Venice.
While written for children, The Prince and the Pauper is both a critique of social inequality and a criticism of judging others by their appearance. Twain wrote of the book, "My idea is to afford a realizing sense of the exceeding severity of the laws of that day by inflicting some of their penalties upon the King himself and allowing him a chance to see the rest of them applied to others..."