Music written for its own independent existence has long been a part of motion pictures. That is, there are soundtracks composed especially for movies, but there are other songs that are used as part of the soundtrack that were written to stand on their own. By and large, these additional songs were used primarily to give the characters a reason to dance. Sometimes there was a Bing Crosby croon to set a scene, which was then used in Elvis movies. But still, it was mostly dancing, especially in beach movies.
Arguably, the most significant change occurred in 1983 with the release of Lawrence Kasdan’s The Big Chill. In this case, the music—and there is an abundance: “I Heard It Through the Grapevine” (Marvin Gaye version), “You Can’t Always Get What You Want,” “Tell Him,” “A Whiter Shade of Pale,” “The Tracks of My Tears,” “Theme from Raiders of the Lost Ark” (Kasdan, along with George Lucas and Philip Kaufman, wrote the screenplay for that movie), “Good Lovin’,” “Strangers in the Night,” “Theme from J.T. Lancer,” “Ain’t Too Proud to Beg,” “My Girl,” “Wouldn’t It Be Nice,” “Quick Silver Girl,” “The Weight,” “Gimme Some Lovin’,” “Bad Moon Rising,” “When a Man Loves a Woman,” “(You Make Me Feel Like) A Natural Woman” (Aretha version), “In the Midnight Hour,” “I Second That Emotion,” and “Joy to the World”—is so fundamental to the plot that it is almost a character onto itself. It isn’t simply to add background to the scenes; even when there is dancing (e.g., the kitchen scene to “Ain’t Too Proud to Beg”) it is more organic than is typically the case in movies. (Presumably when Kasdan pursued his MA at University of Michigan, the proximity to Motown was influential.)
There is a bit of music that wasn’t written for a movie that has fundamentally become part of how the movie remains in memory: “Mrs. Robinson” by Simon and Garfunkel in the Mike Nichols movie The Graduate. It is so entwined with that film that people probably mistake Anne Bancroft’s character’s name for the actual name of the movie.