In films, you have a Music Supervisor and then a Film Composer. The composer, e.g. Hans Zimmer, Danny Elfman, etc., compose the background instrumental music that helps engage with the mood of the story and helps it move forward.
The Music Supervisor will work with the Director and/or Producer to come up with songs that they would like to have on the soundtrack that will be used primarily in the opening and closing credits and depending on what type of movie, you will have several songs played in the background as well.
The Music Supervisor also has the job of working the deals with the artists and bands to get their music into the movie. Often times a huge band will get asked to contribute a song for a movie and they will want too much money or points on the back end and the movie studio is not willing to give it to them. So they will go out and find a lesser known band, though talented, and find a song that is right for their movie.
The Music Supervisor had to work with both artists to get their songs on the soundtrack. That includes negotiating all of the money. Besides, the Music Supervisor along with the Director and Producers gather the bands for the soundtracks. And that is how they’re put together.