You can't tell a story without a way to communicate it. The way you tell a story may be with pictures or sound or written word but there is a separation between the story and the medium. To describe that separation literary theorists, the highfalutin' bunch they are, came up with a word to describe this separation between the conventions of the medium and the story. The diegesis, the classic example everyone and their uncle brings up to explain this is a movie's soundtrack.
We the audience can hear Eye of the Tiger, but The Italian Stallion doesn't have a Walkman. (That's right I still have my old cassette Walkman you fancy I-phone having sons of...
Sorry I started shaking my old man fist there for a second.) Theme music, most of the time, is non-diegetic. It doesn't exist in the universe of the story, but rather is a convention of the medium.
The Forth Wall
Pretend you're going out with your lady friend. (I'm a straight male so lady friend came to mind. If you're of another sex or persuasion change it but lady friend rolls off the tongue, and I'm watching Deadwood while writing this so yeah I'm sticking to lady friend.) going out for a nice evening on the town. You decide to see a play. The actors are surrounded by three walls, but generally do not acknowledge the audience. The audience is behind an imaginary 4th wall.
Remember what I said in my continuity article about hoping the audience forgets it's fiction and just rolls with it? The forth wall is a manifestation of that idea. It's the idea that the agents/characters of the fictional universe try not to let on that they are in a fictional universe. This normally accomplished by having them ignore non-diegetic elements of the medium as well as the audience.
Breaking the Forth Wall
What do Malcolm of Malcolm in the Middle, Iago from Othello, and damn near everything Tex Avery ever drew all have in common?
They all love talking to the audience. They love to break the forth wall. There are sorts of reasons to break the forth wall, to impart the audience with privileged information, to crack wise while not quite behind a character's back,
Messing with the Diegesis
Comedy is often found in the difference between what the audience expects and what occurs. Most folks have been around the block enough to get what's diegetic and what isn't.
One of the trends in modern comedy is to play around with the diegesis and the forth wall, and have characters who are expected to ignore non-diegetic elements and the audience interact with them. Character's commenting on their theme music, waiting impatiently for the slow motion to speed up, reading other character's thought bubbles, yelling at the camera man to get him to focus on what they want.
While I do think it's a tad bit old I do admit it is funny when ever someone says, "How can we lose with theme music this cool?"
There are two master thesi on the subject. The first is "Duck Amuk", where Daffy is pissed off at his animators not to mention his sound effect guys.
The next master thesis of playing with the diegesis is Bryan Lee O'Malley's Scott Pilgrim. One of the major reasons people didn't "get" the movie is because half the fun is guessing what's diegetic and what's not. Scott has his (ex)band playing Death to all Hipsters, his kick ass theme music, interacts with text, and the jury's out on how the editing-spacial relationship works. It's subspace. Just go with it.