Novels need dialogue because it is the only way the characters can really enact. It is also the best way for a character to speak for his or her self. It can also provide exposition, move the plot along and make the story more interesting.
Dialogue can be used for many different reasons. Let's take variety as reason #1:
If you think about a novel as a piece of fabric, I think you can see how mixing up dialogue with the prose can make for a more textured experience.
If there is nothing but prose and more prose, the novel would become a bit like a roll of silk - all the same smoothness. Eventually you stop really feeling the smoothness because it's all the same.
If there is some dialogue, the texture of the fabric gets a bit more knobby. There is contrast. The prose becomes "more prosey" and more significant when set next to the dialogue. The whole experience of reading the book becomes more varied.
One story by Ernest Hemingway that is written almost entirely in dialogue is "White Hills Like Elephants." So, it is through dialogue that the reader comes to understand the conflict, theme, and resolution of the plot.Through their tense and terset conversation, much of the character personalities have been established. With this great economy of words, Hemingway conveys the tone of the story, along with the great divide of opinion.
In novels, the same is true as dialogue often develops character, theme, and other elements of the narrative.
Dialogue is used by authors for a variety of purposes.
As characters in a novel talk with each other, the reader can learn about the setting of the story. The time period in which the story is set, the location of the action, the conflict(s) that are driving the plot can all be revealed and explained through the comments of characters. At the same time, the reader is gaining insight into the characters themselves - the types of people they are, what motivates each of them, how and why they are involved in the story.
Dialogue can also be used as one of the elements that contributes to the development of the telling of the story. An author may put words into a character's dialogue that are preshadowing of a coming event. Dialogue in a mystery story may reveal clues as to "who done it." Dialogue can be used to heighten tension, convey irony, or provide comic relief.