Contrary to popular opinion, humour is no laughing matter. There has been plenty of research on the subject of what comprises humour. The psychology of humour has been puzzling scientists for aeons now.
Q: What do you call a boomerang that doesn't come back ?
A: A stick.
It's quite probable that the last one drew some reaction from you, either a grin or a groan. At what point did you realise that it was a joke ? What did you need to know that it was a joke ? And most importantly, what is amusing about it ?
Sometimes it's some incongruity, some departure from standard thinking. At other times, it's a standard situation viewed from a different perspective. But this is just the tip if the iceberg. There are many aspects to defining what humour is. Humour is classified into many types.
The most common is slapstick. This is a predominantly "visual" form of humour. Circus clowns thrive on it. The most classic examples for slapstick humour can be found in visual media... plays, cartoons and movies. Even today, the best known examples are Charlie Chaplin movies and Tom & Jerry. It's very difficult to do slapstick in prose, and very few writers can actually manage it.
Situation comedy, or sitcom for short, is another common form. It's humour that pertains to a specific situation or chain of circumstances. The very nature of this type of humour makes it tedious to quote an example. A situation has to be built first, to exploit this form.
Television today thrives on this form of humour. The most common type of TV sitcom today can be described as "Six attractive young people hang out together." Variations to the theme include "Five attractive..." and "Four attractive...". As of last count, there are 4 sixes, 2 fives and 3 fours on TV today.
You average "racial-type" jokes come under this category. Blonde jokes, Irish Jokes, Sardar, Polish, Newfie jokes all have a situation, the situation being that they are dumb.
Probably the best suited for one-liners is the pun. Someone once said "The pun is the lowest form of humour if you don't think of it first". I couldn't have put it better myself. Puns usually elicit a groan, not a grin.
Q: What do you call half a dozen Sardars with influenza ?
A: Six sick Sikhs. (sic)
How did this one affect you ?
Bitter comedy is the least "humorous" of all types of jokes. They are paradoxical, because though they are amusing, they will never amuse you. It is not possible to laugh at one of these jokes.
Q: How do you get 33 Ethiopians into a Maruti car ?
A: Throw a piece of bread in.
Funny... or was it ?
Satire is another important form. A faux-pas, or a bad habit, or generally someone or something that's disliked is ridiculed.
Maybe it's the engineer in me (or even the mathematician ;-) that's trying to rationalise humour, and draw out some formulas for it. But it's like Heisenberg's Uncertainty principle. I dare not poke further into the psychology of humour, or I will lose it forever.