Funny Harry Potter music story:
I happened to be in WDW the week that Universal officially announced WWoHP (though it was no secret for a while before that). The very next day, I was in Disney-MGM Studios (as it was still called at the time) sitting at a table by Min & Bill's having a snack.
I suddenly realized that the background music was Hedwig's Theme from Harry Potter. No sooner did I make the realization, when all of a sudden the music cut out and went silent. For a split second I had this image of someone backstage going "No! No! We can't use that anymore! Universal has it now!" and hitting the "mute" button on the park music.
Of course it turned out just to be the background music cutting out before the announcements for the afternoon parade, but the timing of it gave me a chuckle.
Getting back to the original question, large companies like Disney often just pay a blanket royalty fee to the management companies that handle rights to thinks like music. With those fees paid, they can then use whatever music they want from that management company's catalog, in whatever way they want (within the scope of the agreement, of course).
So that's why you'll hear the soundtracks to "Air Force One", "Steel Magnolias" and "Far & Away" in the Soarin queue; music from "Oklahoma" and "Hello Dolly" on Main Street, or even R.E.M. in Dinoland.
And conversely, that's why you hear things like the Reflections of Earth theme being used on NBC.
-Rob