There are two kindof dialogues. Internal and External. Today, we're looking at internal dialogue. Internal dialogue deals with thoughts. As I'm typing this, I'm engaged in internal dialogue with myself. Often stopping to decide what to write. We do this all the time.
In a story, internal dialogue can have a different kind of use. Often a character can be in a situation they like or don't like. Snippets of internal dialogue and can help the reader learn much about the character. I've often used this as a devise for the character to say one thing but thinking the opposite. Internal dialogue can be self-congratulatory. Some people think in fully formed sentences and some in phrases. A phrase or two internally can say a lot.
While internal dialogue is great for showing a character's true nature, internal dialogue can also give the reader information as in the character holding a secret from those they are interacting with. This form of communication can also show the character planning and thus advancing the plot.
So use internal dialogue for effect, using it to add depth to your story.