Writers don't write in a vacuum. Ideas have to come out of something--exposure to other people's works, tv shows, life experiences, or information about the world. Although, I suppose one could claim an idea came out of nothing if you were inspired by the idea of black holes, but the point still stands.
My upcoming book, The Sixth Event, was inspired by a story I wrote in college, which was itself inspired by a book I read as a child. I don't remember the name of the book, or even if it was a book or a short story. The passage I remember is a boy traveled back in time to kindergarten, and his mother was amazed that he could tie his shoes. That idea--of someone traveling back in time to a point in their childhood, but with all their memories intact--stayed with me for years.
The other inspiration for The Sixth Event came from my fascination with geology and the natural world. Human history is fascinating, but we are a small blip on geologic timescales. From the formation of the Earth when it was a swirling mass of magma, up to the last major ice age where we evolved, life has come and gone on a planet that only sometimes resembles the planet as it is now. I wanted a story to acknowledge that, and to acknowledge how much there is to learn about 4.5 billion years of Earth's history--and the history of life on the planet. Knowing what came before can help us figure out what may happen next, especially as we change our own world and head into a new future shaped by climate change. That is what makes humans truly unique out of all of the species that have come and gone before us--we shaped our own world. Hopefully it will turn out for the best.