I would call it a compilation soundtrack. It’s not really different from using some (pre-existing) songs technically.
Maybe no different from a licensing perspective, but if you are talking about songs with lyrics, there is a world of difference. Lyrics take you to the realm of the literal and do not function as underscore. However, a well-chosen piece of pre-existing instrumental music can function perfectly well as underscore, and the viewer may not have any idea that the music wasn’t written for the film in question.