It depends. Sometimes books with nefarious plots are inspired by real events, but they often incorporate fictional elements to make the story more compelling.
Not necessarily. Many books featuring nefarious plots are purely works of fiction created by the author's imagination. However, there could be some loose inspiration drawn from real-life situations or historical events.