The conclusion of "The Lottery" is so surprising because the matter-of-fact, objective narrator manipulates the setting and other character details to make it so.
The word, manipulation, here, is not a negative. All art is manipulation. In this story, the narrator speaks matter-of- factly about the weather ("The morning of June 27th was clear and sunny, with the fresh warmth of a full summer day;...); and about the town and the townspeople (the lottery takes only a mere two hours, and people will be home for lunch, school just let out for the summer, the boys are playing, the men talk of tractors and taxes, and the women gossip).
The matter-of-fact narration contrasts with the ending of the story, when what the lottery really is, is revealed. The reader is set up (again, not a negative) by the narrator. What is revealed as a normal day in a normal town filled with normal people, is not any of the above. That's how the surprise is created.
Details such as the gathering of stones that appear harmless enough when first revealed, provide foreshadowing. In other words, once the surprise ending does occur, it makes sense because of the foreshadowing. The ending is made plausible because of the use of details (like the gathering of stones) that are included in the story prior to the ending.
Foreshadowing is not really the same as a narrator giving the reader hints. The word, hints, suggests that the narrator wants the reader to figure out the ending before the ending occurs. This, of course, would destroy the surprise. Foreshadowing makes sense out of the ending once it does occur.
The speaker in "The Lottery" narrates in a matter-of-fact manner and objectively, with no interpretation or character thoughts included. The horrific ending contrasts with the tone of the story and creates the surprise. And that surprise is made legitimate by the foreshadowing.
Upon a first reading, the conclusion is a definite surprise. However, there are many early hints about the outcome, such as the piles of stones (paragraph 2), the use of the black box (paragraph 5), the "sudden hush" (paragraph 19), the discussion of quitting the use of the lottery (paragraphs 31–34), and Tessie’s anxiety (paragraph 44 and elsewhere). Upon reading the conclusion, students will see that these hints may be read as expressing double meaning. Thus, the conclusion of paragraph 1, in which lunch is mentioned, at first seems to suggest nothing more than ordinary activities on an ordinary day. On second reading, however, reference to lunch may be read as an indication of the insensibility of those who could return home after the stoning and sit down at the family table as though nothing had happened.