One of the most important parts about screenwriting is your ability to control and manipulate information. This basically means creating situations that get the audience interested in your story. If you can do it well, the whole process of writing becomes much easier and much more enjoyable.
When it comes to writing, I think a rule of thumb is that it's almost always good to have certain elements in your story that aren't immediately revealed to everyone. Because if all the cards are face up from the start, it's pretty hard to get your audience excited.
This also applies to your characters. If they know everything about what they want to know and there's no mystery left, it's pretty hard to get them excited and to react to anything either.
So you have to be pretty smart about who knows what and when they get to know it. Keep things secret if you can. Reveal information gradually and mislead the audience without alienating them.
I don't know if there's a better example of this than the sixth episode of 30 Rock's second season. In 'Somebody to Love', Liz Lemon suspects that his neighbor Raheem is a terrorist because he acts suspiciously.
After certain misleading revelations Lemon becomes so convinced about Raheem running a terrorist cell that she decides to contact the Department of Homeland Security.
Raheem is taken away and Lemon feels like she has done her job as an American citizen. Only later will she and the audience find out that Raheem isn't a terrorist. Instead, the maps in his house and the video that he did with his brother in the park was to audition for the Amazing Race.
Lemon feels embarrassed and Raheem.. well, he promises that he'll show everyone (as if as he would become a real terrorist).
Honestly, I don't think the pay-off could have been any better and boy did Lemon feel bad about her mistake. She couldn't have been any more wrong about them.
The episode was written by Tina Fey which didn't really surprise me at all. Everything works in it, information is gradually revealed, the audience is mislead but not alienated, the final reveal is one of the best that you'll ever see and there's even a lesson to be learned.
If you want to learn something about storytelling, this is an episode that you want to watch again and again.