Much to the dismay of screenwriters, movies scripts aren't always set in stone. They are often like living objects constantly evolving during the filming process. Some films, like Jaws and Annie Hall, don't even have a finished script when the cameras start to roll.
Actors and actresses are regularly ad libbing, improvising or going off-script while reciting their lines. Sometimes the directors hate it - other times they love it. Occasionally the improved lines become immortalized as some of the most memorable in cinema history.