Realism is literary movement that tries to represent the world as it is, both externally (in terms of plot and so on) and internally. Realistic fiction is especially concerned with the psychology of characters and tries to honestly represent their internal states. Books such as "Madame Bovary" or "War and Peace" represent the realist movement in nineteenth-century European literature.
Naturalism, on the other hand, is an offshoot of realism. While naturalist narratives also deal with the "real world," they are less concerned with the internal state of the characters and instead place them in the larger context of being. Unlike Realism, where characters struggle with choices they make and the ethical repercussions of those choices, in naturalist texts, nature or circumstance act upon the characters. The characters may make choices, but those choices are subordinate to much larger forces that make the individual irrelevant.
"To Build A Fire" is a great example of naturalism. The story is about the awesome power of the cold and how the man's choice to ignore advice and travel alone costs him his life. While the man thinks he knows better, his self-confidence proves to be tragically irrelevant. The story is not concerned with the moral implications of the man's choice. There is not much psychological complexity to him; most of his thinking is about how cold it is and the lunch inside his coat. He is, in effect, as much an animal as the dog that follows him. Perhaps the simplest way to explain this story is that it is an example of what happens when inexperienced people get into dangerous weather.