After dark, Stanley digs in the hole and Zero sneaks into camp to get water and food. Zero finds frosted flakes, which he and Stanley both find revoltingly sweet after more than a week of eating only onions. Stanley and Zero finally dig up a suitcase and just as they are preparing to leave a light shines in their faces and they find the Warden standing in front of them.
The Warden shines a flashlight on Zero, who is holding the suitcase until she sees that there is a deadly yellow-spotted lizard on the suitcase. Stanley realizes he is standing in a lizard's nest. The Warden, along with Mr. Pendanski and Mr. Sir, wait for the lizards to leave. The Warden talks about how she grew up digging holes with her parents, looking for the suitcase. Mr. Sir makes reference to a woman asking questions and the A.G.
While Stanley and Zero try to stay still, the Warden, Mr. Pendanski, and Mr. Sir discuss what to tell "the woman" and "the A.G.". Mr. Pendanski cruelly laughs that there will be plenty of graves to bury Stanley and Zero in after they die. The Warden says she will tell "the woman" that Stanley was delirious and ran away and the lizard bit him. Mr. Sir tells Stanley that Stanley's lawyer had shown up the day before to say that Stanley is innocent of stealing the shoes.
As the sun comes out, the lizards crawl away from Stanley. Zero asks him if his first name is his last name spelled backwards. Mr. Pendanski arrives with a woman and a man. The woman says she is Stanley's lawyer and tells the Warden that she will file charges against not only the Warden but also against the entire state of Texas if anything bad happens to Stanley. The Warden says that Stanley stole the suitcase that Zero is holding. The lizards scurry away and the Warden tries to take the suitcase from Zero but he says it belongs to Stanley. Zero shows everyone the other side of the suitcase where the name Stanley Yelnats is printed.
Stanley's lawyer's name is Ms. Morengo and the man with her is the A. G., the Attorney General. The Warden says that Stanley does not even know what is in the suitcase and demands that he open it. Ms. Morengo tells Stanley not to open the suitcase and that he can leave freely. Stanley refuses to leave without Hector. Ms. Morengo demands to see Hector's records but because Mr. Pendanski has erased m any of them, they cannot be found. Ms. Morengo takes Hector and Stanley but before they leave Squid gives Stanley his mother's phone number and asks Stanley to call her and say that Alan (Squid) is sorry.
The narrator relates how yellow-spotted lizards never appeared in Green Lake until after the lake dried up. One hundred and ten years ago people used to hunt rattlesnakes in the desert and they knew there were lizards there. Sam gives rattlesnake hunters onion juice to drink because lizards won't bite people with onion blood. Back in the present day, Ms. Morengo shows Stanley and Zero the cure for foot odor that Stanley's father has invented. It smells like peaches. Ms. Morengo tells Stanley that the sneakers were stolen at 3:15 pm and that Derrick Dunne said that at 3:20 Stanley was still fishing his notebook from the toilet in the boy's bathroom. This proved that Stanley didn't steal the sneakers. Zero says that he stole the sneakers and Ms. Morengo pretends not to hear him and tells him not to say it again. For the first time in over 100 years, rain falls on Camp Green Lake.
The narrator fills in some of the "holes" in the plot. Stanley's father invented his cure for foot odor the day after the great-great-grandson of Elya Yelnats carried the great-great-great-grandson of Madame Zeroni up the mountain. Camp Green Lake was closed and the Warden, Ms. Walker, was forced to sell her family's land. The camp will soon be a Girl Scout camp. The suitcase contained some jewels and many valuable deeds and stocks. Stanley and Hector each received almost a million dollars from these finds. Stanley buys his family a house and Hector hires a private investigator to find his mother. The narrator speaks directly to the reader, saying that although the reader is sure to have more questions, a scene at the Yelnat's house will best explain Stanley and Hector's situation. Stanley and Hector watch a commercial in which Clyde Livingston advertises sploosh, Stanley's father's cure for foot odor. Clyde Livingston is at Stanley's house in person, watching the commercial as well. Hector sits with a woman who looks just like him. She sings him the same song that Madame Zeroni taught Elya Yelnats.
Once again, the history of Sam and his onion remedies explains events that occur in the present day. Stanley and Hector (Zero) avoid being bitten by the deadly yellow-spotted lizards because they have been eating nothing but onions for more than a week. This fact makes the lizards, which appear to be a menace, into a help for Stanley and Hector, successfully keeping the Warden away from them until Stanley's lawyer arrives to help them. The story of the lizards is another device that the author uses to suggest that fate has a hand in Stanley and Hector's story. Although Stanley's family has had bad luck for generations, all of the unlucky events have lined up to help Stanley and Hector in some way. This suggests that everything has happened for a reason and that instead of always being in the wrong place at the wrong time, perhaps Stanley has been in the right place at the right time.
When Stanley and Hector are given the freedom to leave Camp Green Lake, some of the other boys are liberated as well. Squid, who has always taunted Stanley about his correspondence with his mother, feels able to ask Stanley to help him contact his mom in order to apologize. Squid's meanness towards Stanley is really the result of insecurity and jealousy. The other boys also give up their jealous natures and seem genuinely happy for Stanley and Hector when they leave Camp Green Lake. This emotional release is mirrored by the rain that falls on the camp, which is a symbol that the curse of Green Lake is finally over. As Stanley is returned to his parents, so Hector is able to locate his mother. By caring about Hector himself, Stanley effectively enables him to find his family. The Warden and Mr. Pendanski thought that no one would care about Hector because, being mean people themselves, they underestimated the power of friendship. Just as in a fable or fairy-tale, there are many morals at the end of Holes. Fate is shown to be a powerful force, friendship and family is proven to be an important role in everyone's lives, the destructive power of meanness and cruelty is demonstrated, and the importance of loyalty and fulfilling promises is emphasized. By linking three separate stories that occur in different time periods, the narrator also shows how all actions lead to reactions and that history is an important force in everyone's life.