I think the integration of music in a movie plays one of the key roles in producing a great movie. I have also seen some movies like the award-winning "A Separation" which did not have any background music at all! So my question is how is it decided which parts of a movie need background music integration? Is there any rule for that? Or does it just depend on how the director (or music composer) feels about the movie?
As there are no hard and fast rules for the use of music in filmmaking, this question runs the risk of becoming conversational rather than providing a succinct answer.
That said, I am in the middle of finalizing the score on my latest short animated film - so I'll share my reasoning for the inclusion of the background music in the hope that it answers your question.
While working with my composer, I had several motives in mind for the musical cues he delivered.
Firstly, music (and sound design in general) are a vital part of the overall film language (with some exceptions - see The Artist, et al ;)), and I needed musical cues that highlighted the emotional impact of certain scenes. There are moments of high tension, comedy and sadness in the film, and my composer has enhanced these moments dramatically by reinforcing the rhythm of the edits and also providing a 'pointer' for the audience as to how they should be feeling at any given time. Music is a very powerful tool for controlling your audience's feelings.
Secondly, I instructed him to create a series of leitmotifs for the characters in the film. This is a technique used most famously by John Williams in the Star Wars saga, whereby each character has their own theme which reoccurs throughout the films, albeit in different styles, reflecting the characters' current state of mind/situation/interaction with others. Look at Vader's theme. Heavy brass through the original trilogy, and then played on a harp as he dies - beautiful and deeply moving. For my film, I have a main character who is the antagonist (villain) of the piece, and is at odds with the other characters. For this reason, I had his theme not only jar against the rest of the soundtrack, but it becomes strained and unravels as he becomes more dangerous during the film's progression.
I also asked my composer to create a theme for the landscape (there is mountain climbing involved), and we used this opportunity to include ethnic instruments that reinforce the geography and the nationality of the protagonists. So we ended up with an epic score that sounds like Max Steiner's King Kong soundtrack with elements of Tibetan woodwinds and thumb cymbals woven in!
This is just the tip of the iceberg when it comes to music decisions, but I hope it gives you a good starting point in answer to your question.