Kierkegaard ... wants to claim that there is an essential connection between humor and religious life ... Kierkegaard holds that the highest and deepest kind of humor is rooted in a life-view which is recognizably religious, and that all humor is at bottom made possible by those very features of human life which make the religious life possible.
Kierkegaard was a Lutheran pastor who lived in Denmark, and did most of his writing in the 1840's. Evans continues:
To understand Kierkegaard's claims here one must try to understand the place of humor in his theory of the stages or spheres of existence ... there are three stages or spheres of existence. The aesthetic life is the natural or immediate kind of life in which everyone begins, where one simply attempts to satisfy one's natural desires or urges. The aesthete lives for the moment. The ethical life is the life in which one grasps the significance of the eternal and by ethical resolve attempts to transcend one's natural desires and create a unified life. The religious life is the life in which one recognizes the impossibility of actualizing the eternal through positive action and instead one attempts to grasp it through repentance and suffering.
In short, the third stage is the stage in which you figure out that the second stage is impossible! The options here for irony and humor should be self-evident. As Evans phrases it:
Irony constitutes the boundary between the aesthetic and the ethical, while humor constitutes the boundary between the ethical and the religious.
Because a sense of ethical outrage, even if hidden, motivates irony, it carries one from the aesthetic phase to the ethical phase; when one finally realizes the absurdity of being, on the one hand, obliged to always act ethically, and being, on the other hand, incapable of always acting ethically, it is then humor which allows one to transcend the ethical phase and enter the religious phase. It is in this absurdity and humor that Kierkegaard's Lutheranism shows itself. Professor Evans puts it this way:
... forgiveness which is offered freely ... makes it possible for the earnest individual to smile at the contradiction between his life and the ideal he sees in Christ.