How does humour arise from conflict?
In The Importance of Being Earnest, the conflict arises from the fact that two friends, Jack and Algernon, lead double lives for their own pleasure. However, things become complicated when they are basically both found out by the respective ladies who are engaged to marry them (understanding that both men are named Ernest), and decide to walk away from them momentarily.
The conflict of double identity is mocked and made ironic by Wilde in that, despite of the ugly nature of double dealing, Victorian society cared less about double lives but more about superficial lives. When Lady Bracknell asked Jack about his peerage, all he could really tell her was that he was found inside a handbag in Victoria Station.
That was a problem because, despite of the fact that Jack had a double life, and that Algernon was as well, the fact that Jack could not produce a name for a family (or a pedigree) was even more important than so.
To this, add that Gwendolen and Cecily, Algernon and Jack, and Ms. Prism, even, are characters that contradict themselves completely throughout the play. All insist in leading a fantastic life born out of their imagination, and become completely oblivious to the actual problem in front of them: They are all mocking each other.
Yet, in the end, it is Wilde who mocks them by presenting them as characters who are funny but dimwitted, interesting but superficial, and all of them completely trivial and concerned only with their own idiotic view of life.