The developing friendship between a white boy (Huck) and a black slave (Jim) is the main driving force of this novel. It is this friendship that makes Huck’s decision of whether to help Jim escape slavery so difficult. Huck's ultimate choice pits him against everything had previously known to be right. Huck makes several comments throughout the book that let us know how seriously he takes his friendships. He values loyalty most highly, and that leads him to stick with Jim (who proves his loyalty to Huck several times) to the end. Throughout the course of the story, many friendships are tested again and again, but whether or not the ideal of friendship prevails at the end of the day is subject to debate.
Because they are in constant close proximity on the raft, the self-serving friendship of the duke and the king acts as a foil to the selfless friendship between Huck and Jim.
Although they grow closer as the story progresses, Huck and Jim’s friendship is never made complete because it is still affected by Jim’s race even at the end of the novel.