Jack had proposed to Gwendolen, but soon was interogated by Lady Bracknell. He was refused by Lady Bracknell who much preferred Ernest as a suitable husband for Gwendolen, and under no circumstances Jack. This caused Jack to kill off Ernest, who was his fictional brother.
As Ernest gave Gwendolen his address to the country house, Algernon quickly took notes. Later Jack arrived back at the Manor House dressed in mourning; he claimed that Ernest had died of a severe chill. The whole plan was ruined when Algernon arrived, pretending to be Ernest. This literally shocked Jack, that his brother Ernest was alive and well.
Now with both men accused of deceit and separated from their loves, Jack tried to get Algernon to leave to the city. But in order for Jack to be able to marry Gwendolen he had to give consent for Cecily to marry Algernon.