Entertainment—whether it's books, music, TV, movies, or art—is a way for people to connect to those around them, escape from those around them, find an emotional touchstone, or simply entertain themselves. And since it's all entertainment, it's natural that the subgenres would blend into each other (it's not an accident that we cover TV and movies at Heroes and Heartbreakers as well as books—romantic fiction is spread across genres!).
It makes sense, then, that authors would get inspired by music, and vice versa. Many authors create playlists for the books they're writing, using the songs as a sort of Pavlov's dog to get them into the creative process. For example, in a post she wrote about the tracklist she did for Chaos Burning, Lauren Dane (whose twitter feed is filled with what she's listening to at the time) said,
Music is one of the things I use to keep my head in the story despite constant interruptions from kids, other books to deal with (copy edits, final pass pages, promotion, all that jazz).