According to Professor Paul Brians of Washington State University, realism in literature was a movement that, in reaction to Romanticism, focused on the real world and familiar kinds of characters as opposed to the fantastical or supernatural. Naturalism was a later extension of realism marked by a pessimistic attitude towards humanity and an attempt to apply the scientific method to the writing of fiction.
Professor Brians notes that while many identified the French novelist Balzac as the progenitor of literary realism, it was Flaubert's "Madame Bovary" that was most important in cementing realism as the dominant mode of the novel. Flaubert wrote "Madame Bovary" in a realistic literary style and within a realistic world, but also wrote the lead character Emma as someone Romanticism failed and deluded.
Émile Zola was the main practitioner of naturalism and the inventor of the term. Zola attempted to approximate the scientific method when writing his novels, emphasizing the role the environment and background of his characters played in their behaviors and fates. Instead of the triumphant individual of Romanticism, readers found in Zola characters shaped by their history. One of Zola's chief emphases, and one of naturalism's, was on humanity en masse, on group behavior and dynamics. An extreme, pervasive pessimism typically colored the depictions of humanity and societies in literary naturalism.