Impart information to the reader that would normally and naturally be talked about by the characters
Break up long stretches of narrative
Quicken the story pace
Foreshadowing future events
To ensure good dialogue:
Let the dialogue speak for itself
Keep the dialogue short
Make sure the reader knows who's talking by using speech tags, "gestures" [body language movements], his or her unique use of language, and direct address. Use the latter sparingly.
Avoid:
"-ly tagalongs" [adverbs tacked onto speech tags that tell the reader how to interpret the dialogue]
"Said-bookisms" [replacements for he said/she said speech tags; e.g., he expostulated]
"As-you-know-Bobs" [unnatural dialogue present only to convey info to the readers since the characters already know the info]
Dialogue without tension
portraying "ums", "ers", and other everyday conversation fillers
Too many direct name references (too much "direct address")
Uncharacteristic dialogue
Unnecessary dialogue
Excessive dialect
Repeating information in dialogue that's already been covered in narrative