They rarely do. It seems they mostly rely on their own experiences (which is probably why there's always plenty of stories about high school students, office workers, manga artists, writers and neets), the stories they read (copy-pasted themes and even entire plot arcs), and then their own...