Humor appears to be a largely human trait, although some higher primates show some form of sense of humor This could be because humor is largely language based (e.g.: Patient: "Doctor, I've got a strawberry stuck up my bum." Doctor: "I've got some cream for that!") so its hard to tell if other animals can find things funny. There is a fair amount of research into why humans have evolved to have a sense of humor. For this trait to be selected for by evolution, it must have provided our ancestors with some advantage in finding a mate and passing on their humorous genes to the next generation.
There is no denying that humor is an important part of human life. It helps us to deal with stress, lets us communicate ideas, feelings and opinions, has a positive effect on the immune system and is considered a defining trait of being human. So what does humor do for us? Firstly, when you smile and laugh, you appear unthreatening to others and it acts to include others in your social group. Smiling itself is a way of showing that you are a friend, not a foe, and showing submission to another person. Humor could be acting to help bonding between humans and to reinforce relationships. Today, many of us find someone with a sense of humor far more attractive than those without, as laughter can be contagious and makes us happy.
The fact that we find someone who has a sense of humor more attractive than someone who doesn't get a joke supports one of the theories of why we evolved to have a sense of humor Much of humor is based on things that go against the norm and defy logic. For example, when someone throws a cake in their friend's face, we laugh because it is unexpected. To understand jokes we often need to be able to make links between things that are normally unrelated. The ability of humans to take knowledge learned from one experience and use it in a different situation is part of what makes us so special. So humor requires a certain degree of intelligence and may have evolved as an indicator to a prospective mate that we are smart and therefore carry good genes. Laughing at a joke is our way of broadcasting how great our sense of humor is to everyone around us. But is this all? I've read some articles that have suggested humor has its roots in learning. Laughter is fun so it positively reinforces the recognition of something that goes against what we see as normal. It can also help us accept situations where we are wrong, cushioning us against the emotional anxiety that can accompany this. Because humans don't like to be wrong, its sometimes difficult to accept new ideas that go against our beliefs; so we could use humor to get around this problem and effectively enjoy getting things wrong.
Another explanation could be the superiority theory which assumes that we laugh at others' misfortune (come on, you can't say you've never suppressed a giggle watching someone stack it while walking down a busy street?). Apparently, humans are in constant competition with each other, always looking for shortcomings in our fellow humans. Laughter is the realization that we are better than someone else.
The incongruity theory is one of the most influential theories of humor and laughter. The idea is that humor is based on the resolution of incongruity. This theory states that something is funny when it is different from what is expected and the understanding of this incongruity is what makes something humorous. Again, it requires intelligence to understand an incongruity and our laughter tells the guys or gals that we would be a good parent for their babies.
Two hunters are out in the woods when one of them collapses.
He doesn't seem to be breathing and his eyes are glazed. The other
guy whips out his phone and calls the emergency services. He gasps:
"My friend is dead! What can I do?" The operator says:
"Calm down, I can help. First, let's make sure he's dead."
There is a silence, then a shot is heard. Back on the phone, the
guy says: "OK, now what?"

