Disturbed by Victorian England's frivolous upperclass that had little concern for those less fortunate, and concerned for the welfare of the increasing number of poor in London, Charles Dickens perceived the society of his day as a social prison.
The character who best illustrates this perception of Dickens is Magwitch, the convict, who grew up as a gamin in London:
Tramping, beggin, thieving, working sometimes when I could...a bit of a poacher, a bit of a laborer, a bit of a wagoner, ...a bit of most things that don't pay and lead to trouble, I got to be a man.
At Epsom races, Magwitch is exploited by the despicable Compeyson, who has Magwitch carry out the "traps" that Compeyson sets for others. When they are caught and brought to trial, Compeyson stands in the dock as the picture of a gentleman, with his fine clothes and "white pocket handercher," but Magwitch appears as "a common sort of wretch." And, even though Compeyson is much more culpable of the crimes since he initiated them, Compeyson's appearance of a gentleman along with his "counselor" bring him a lesser sentence than that doled to Magwitch. Thus, there is a justice for the rich, and a justice for the poor in the Victorian setting of Great Expectations.
The past of Magwitch certainly haunts him his entire life. When he goes to New South Wales and is fortunate enough to receive a fortune from his old employer, Magwitch can only enjoy it vicariously by sending money to Pip in the hopes of making him a gentleman. For, he cannot uplift himself socially in any way.
In Pip's case, his great expectations of becoming a gentleman are foiled, for he is never introduced into London's "polite society." Instead, he dines sometimes in the company of Mr. Jaggers, a rather unscrupulous lawyer who entertains men such as Bentley Drummle. And, while Mr. Matthew Pocket is of the gentry, he lacks the financial assets necessary for entrance into the world of the upperclass.
Despite the attempts of characters to socially move upward, Dickens's novel is haunted with images of jails and prisons as Mr. Pocket is imprisoned in a nonsensical marriage, Magwitch is an escaped convict, Miss Havisham resides in a self-imposed prison, and Pip has imprisoned himself in a belief that he has been supported by Miss Havisham so that he can marry Estella.