The things that embarrass us make us laugh a little; seeing someone else in an embarrassing position makes us laugh a lot. Audiences like to see characters in a better-him-than-me situation.
We may admire or envy successful people, but rarely do we laugh at them. With the frustrated we feel their pain and laugh in recognition.
Remember that scene from I Love Lucy with Lucy working in a candy factory, where the belt sped up and the candy kept coming faster than she could possibly box it? The more frustrated she got, the more we laughed. We all know what it's like to fall behind no matter how hard we try to keep up. Some games, like Playbook (aka Every Other Line, where one character plays it strait while another reads their dialogue from a play) or Two Line Vocabulary (where one actor must deal with other characters who are limited in what they can say to two generic lines of dialogue), are based on frustration as the character with free action must try to reach his goal with the help of these unresponsive people.
Mixing frustration with embarrassment, as in sexual frustration, is really funny. Entire plays have been written about sexual frustration, from Lysistrata to Last of the Red Hot Lovers, and it fuels an entire film genre of teen sex comedies.
Surprises that make sense make us laugh. Just being weird for the sake of strange is confusing rather than funny, but when something weird happens that we didn't expect -- but that makes sense in context -- we laugh.
The uppity slave or pompous professor are as old as Greek old comedy, and have been with us through Commedia, Shakespeare, Farce, and right up to today. Insults, outsmarting, the high brought low. Jerry Lewis once said that he started wearing a tuxedo in his act because when he did a fall in a cheap suit he got a chuckle and had to rush back up and keep going, but when the rich guy fell on his ass the audience howled and he could stay down and catch his breath. We like to see the big guy get his and the little guy win. For an extended treatment of status in improv see the excellent discussion in Keith Johnstone's Impro: Improvisation and the Theatre.
And most of all: Honesty (recognition: the ah-ha ha-ha.)
You know what's really funny? Truth. Those things we think we're the only one who thinks, but that everybody really thinks but is afraid to talk about (Got that?). It's Andy Rooney's "Did 'ja ever notice...?" or Seinfelds "Why is it that...?".Everybody has their weaknesses, but what we don't realize is that we all have many of the same weaknesses that we just won't admit. It's the comedianís job to ferret out those commonalities in the human condition and admit to them. And when, as audience members, we see those parts of ourselves faithfully rendered, we laugh at the comedian, and also, through the comedy, ourselves. But it only works if it's real, if it's true. If it doesn't connect, if it's just wacky stuff we can't relate to, it ain't funny. See Close, Halpern, and Johnson's aptly named Truth In Comedy.