Pudd'nhead Wilson was written during Mark Twain's "pessimistic period." At the time, Twain was living in Italy, attempting to recover from his recent bankruptcy. To raise some funds, he sold the rights to the novel to Century Magazine for $6,500. The magazine ran Pudd'nhead Wilson in seven monthly installments, which first came out in December 1893 and concluded in June 1894. Shortly thereafter, in 1894, the book was published and released by the American Publishing Company.
Twain started out writing an entirely different story. He had been inspired by a set of Siamese twins he had seen in Europe, and subsequently decided to write a comedy about Siamese twins. The novel's original subjects were "those extraordinary twins," Luigi and Angelo Capello. This initial version included such other characters as Aunt Patsy Cooper, Aunt Betsy Hale, two boys, and Rowena.
But as Twain continued writing, "the tale kept spreading along" and new characters "got to intruding themselves and taking up more and more room with their talk and their affairs." Two characters, Pudd'nhead Wilson and Roxanna, proved particularly disruptive to this original manuscript. Moreover, these two pushed yet another intruding character, Tom Driscoll, to the forefront of the novel.
Twain now found himself with two stories uncomfortably meshed together. One was a comical farce focusing on Siamese twins, while the other was a tragedy about racial identity and slavery. He concluded that the two storylines could not appropriately coexist, and that one needed to go. He decided to extract and discard the former, as it had long since been eclipsed by the newer characters and plot. After some reworking of the story, Pudd'nhead Wilson emerged.
When the American edition of the novel came out, it included, as an appendix, the original sections that Twain had removed in reworking the book. These appended sections were entitled Those Extraordinary Twins. This appendix was absent from the original British edition.
In Pudd'nhead Wilson, Twain delivers a scathing critique of slavery and race relations in the American South. He highlights the arbitrariness of racial classifications and distinctions, by showing how easily Roxy (a slave) is able to switch her own child with her Master's offspring. The young, usurping slave grows up amongst whites without drawing any suspicions. Twain thus demonstrates how artificial and constructed racial distinctions truly are.
In crafting this critique, Twain may have been influenced by the U.S. Supreme Court case of Plessy v. Ferguson, which was pending (though had not yet been decided) at the time he was writing. The plaintiff in the case, Homer Plessy, was one-eighth black and physically appeared to be white. Under Louisiana law, Plessy's tiny fraction of black blood was sufficient to make him legally black, and he was therefore prohibited from riding the train in the "White" car. Instead, he was relegated to the "Colored" car. Plessy went to the Supreme Court and challenged the law. The Court ultimately decided that the state could constitutionally require that African Americans use "separate" accommodations, so long as these accommodations were "equal" to those enjoyed by whites. This "separate but equal" doctrine was later overturned in Brown v. Board of Education.
Like Plessy, two of Twain's characters in the novel (Roxy and her son Chambers) appear to be white, but are legally classified as black because of a small fraction of their blood is black (for Roxy's case it is 1/16, and for Chambers it is 1/32). Just as Plessy's being classified as black condemns him to an inferior position in American society, Roxy and Chambers are forced into slavery as a result of their black heritage.