In order to understand The Importance of Being Earnest fully, one needs to set it in the context of Wilde's life and literary output. Until his first expression of homosexual feelings in 1886, his works (mostly poetry) had been fairly second-rate, shallow and derivative. However, this revelation seemed to be a turning point: his productivity increased, and the quality much improved. The guilt he felt about his homosexuality and his treatment of his wife, Constance, and their two children, could be seen to have honed his ability to write on the themes of evil, crime and suffering. Until he wrote The Importance of Being Earnest (his last play) in 1886, his career can be divided into three basic units.
The first was that in which he wrote predominantly fairy tales in which the good and the pure always triumph, the best known examples being "The Selfish Giant" and "Lord Arthur Saville's Crime". However, Wilde's tales differ from the norm in that they deal with the evil within human beings rather than as an external force. Written for "children from eight to eighty" they can be seen as an urge within himself to fight his own 'evil' and remain in a world of childlike 'innocence'. At this time, he also wrote critical essays like "The Decay of Lying" and "The Critic as Artist", written in a playful, witty style which masks their seriousness.
By 1890, Wilde seemed to have come to the conclusion that the 'evil' in himself could not be controlled, and so explored the theme not within the safe confines of a fairytale, but in a dark, sinister novel with a tragic ending. The Portrait of Dorian Gray, as its title implies, has a central character whose nature is grey: his childlike innocence is gradually corrupted. He becomes increasingly evil as the novel progresses, finding beauty in evil, though he sometimes yearns for his lost innocence. Finally, he becomes so evil that he cannot bear it. On discovering that he cannot recover that which is lost, he grows desperate and accidentally kills himself. Despite Dorian's immoral behaviour, the novel has a moral end, as it shows what happens to someone who cannot control evil impulses. However, the press still attacked the novel for its perceived immorality. So, Wilde set forward what was essentially the same message in a social comedy, the play Lady Windermere's Fan, which highlighted the ambiguity of class, nature and evil. This was much more successful with the public.
Late in 1891, Wilde wrote his chilling one-act symbolist play Salome, in which human nature is presented as entirely black. But Wilde was not unhappy about this; declaring that human nature is totally and irrecoverably evil, and that we should express this rather than hiding it. Banned from the English stage by the Lord Chamberlain, Wilde again responded by repeating the basic message in a light comedy, A Woman of No Importance (1892). Underneath this play's conventional melodramatic surface and sparkling wit is the idea that human nature is totally evil. In both these plays, Wilde is a Satanist, preaching the acceptance and expression of inner depravity and denying that there is any goodness in human nature.
However, Wilde felt that he had gone too far, and so The Importance of Being Earnest can be seen the product of a reaction against lost innocence. The tone perfectly recaptures this, and the characters who inhabit the play are really babies who are playing at life. When Jack is consulting Dr Chasuble about being christened, the Canon offers to christen him at five o'clock along with some newly-born twins. In his response - "Oh! I don't see much fun in being christened along with other babies. It would be childish" - Jack refers to himself as a child. He and the other characters, though physically adult, mentally and psychologically remain in childhood, innocently imitating the behaviour of real adults - thus their attempts to marry are attempts to ape the behaviour of grown-ups. Their actions are quite babyish until the game is interrupted by real life. Thus, without actually returning to the fairy-tale genre, Wilde can recapture the safe, closeted world of childlike innocence.
But what is it, basically, that The Importance of Being Earnest reduces to innocence and nonsense? It seems to be both, most obviously, the English upper-class society that had adopted Wilde and made him famous. It also seems to be Wilde himself. In his letter from prison, "De Profoundis", Wilde wrote of Pater's The Renaissance (1873) as a "book which had a strange influence over my life". In his conclusion, Pater outlines his theory that the only thing we can really know is our own personality. Wilde's dominant theme is the evil within himself, though he generalised from personal experience and spoke of the evil in human nature. Wilde reduces the messages of his earlier works to farce, thus unmasking their nonsense.
The Importance of Being Earnest earnestly reveals to us Wilde's real world, his true personality, as he saw it at that time.