In the introduction to the published screenplay of When Harry Met Sally, screenwriter Nora Ephron tells how the film grew out of a series of conversations she had with director Rob Reiner and producer Andy Scheinman. They told her about their lives, more than confirming her worst nightmares about men.
Harry wound up being based on Reiner. Funny, but dark and depressed, and strangely proud of his depression. As soon as he's finished having sex, he concocts excuses to leave, as Reiner and Scheinman had admitted about themselves to a horrified Ephron.
Sally, Harry's natural opposite, wound up being based on Ephron. Bright, optimistic, certain she's over a guy when she isn't. She orders a sandwich with fifteen parenthetical conditions, something Reiner and Scheinman noticed Ephron doing repeatedly and unselfconsciously. "I just like it the way I like it," she said, and that wound up in the film.
Most movies start in the writer's mind, and the director takes over and gets final say. But with two main characters, Harry could state Reiner's opinion, and Sally could refute it with Ephron's.
"We told you about men," Reiner and Scheinman said to her, "now tell us about women." She described how women send themselves flowers to fool their boyfriends into thinking they have multiple suitors. That wound up in the movie. As did her repeated sexual fantasy about having her clothes ripped off by a faceless man. And she revealed that women fake orgasms.
Shocked as they were, Reiner and Scheinman wrote a conversation about that, and Ephron added it to an existing scene. At the first read-through, Meg Ryan suggested Sally actually fake an orgasm in front of Harry. In a public place. Billy Crystal came up with the immortal punchline, given to a nearby lady: "I'll have what she's having" - one of dozens of lines he added.
When you write a script, it's like delivering a great big beautiful plain pizza, the one with only cheese and tomatoes. And then you give it to the director, and the director says, "I love this pizza. I am willing to commit to this pizza. But I really think this pizza should have mushrooms on it." And you say "Mushrooms! Of course! I meant to put mushrooms on the pizza! Why didn't I think of that? Let's put some on immediately." And then someone else comes along and says, "I love this pizza too, but it really needs green peppers." "Great," you say. "Green peppers. Just the thing." And then someone else says, "Anchovies." There's always a fight over the anchovies. And when you get done, what you have is a pizza with everything. Sometimes it's wonderful. And sometimes you look at it and you think, I knew we shouldn't have put the green peppers on it. Why didn't I say so at the time? Why didn't I lie down in traffic to prevent anyone's putting green peppers onto the pizza?"
Film is the most collaborative art form. At its best, it shows what the collective intelligence of a team can produce. The success of When Harry Met Sally can't be credited to any single participant. None of them has made a pizza anywhere near as delicious since.