Music and Literature have always maintained close relations, creating mutual expressive and linguistic solicitations.
Poetry, theater, but also (mostly between XIX and XX century) fiction got interested by the dialectic created by music and literature. At the origins of poetry there's an essential sound element, melodious to the point that it's impossible to just read a poetic song. We need to listen to it, as the ancient authors did with epics.
Essentially, literature and music have the same purpose: recount.
A personal experience or an imaginary story? It doesn't matter, 'cause everything can be used as inspiration for a song or a book.
On the other hand, they are both art forms so they are the mirror of the human soul, the reflection of dreams and feelings.
There's always been a relationship of mutual influence and inspiration between literature and music. Moreover, writing a song is not like writing a book. Becoming inspired by a great novel to create a song can be a good starting point and an exciting challenge. Moreover, musicians and artists remain fascinated by literature like everyone else and, like everyone else, they can fall in love with a fictional character, reflecting within themselves so that they can escape from the monotony and the concerns of ordinary life.
In the history of music, there are countless examples of artists basing songs off of literary works. For example For Whom The Bell Tolls by Metallica takes its name from the homonym book of Ernest Hemingway: a suitable inspiration, as the lyrics of the song discuss the futility and absurdity of war.
The Cure, led by Robert Smith, was inspired by the apathetic existentialism of Albert Camus's novelette novelette The Stranger, to write the song Killing an Arab (which led the band to be unfairly accused of racism) is the description of a specific moment of the novel explained by the apathetic protagonist, Meursault.
Lastly, there is the example of David Bowie's album Diamond Dogs. The album was inspired by George Orwell's 1984 of George Orwell, which portrays a distressing scenario of a totalitarian dystopia.
Therefore, quoting the German poet Heinrich Heine:
" Where words leave off, music begins. "