Elya Yelnats' story is a crucial part of the overall plot of 'Holes'. His actions in the past led to a family curse, which Stanley, his descendant, is living under. This curse is what gets Stanley into the situation at Camp Green Lake. So, Elya's story is the starting point of the chain of events that Stanley has to face.
In 'Holes', Elya Yelnats' story sets the stage for what Stanley Yelnats experiences. Elya's actions in the past led to a curse on the family. Stanley is sent to Camp Green Lake. While there, the mystery of the holes is gradually revealed. The story shows how Elya's old story in a far - away land is linked to the present - day situation at the camp. It's a story of family, fate, and the discovery of hidden secrets through Stanley's journey at Camp Green Lake which was all influenced by Elya's past.
I'm not sure which specific 'book holes' you mean. But generally, the lesson of a story could be about friendship, like in 'Charlotte's Web', where the lesson is about the value of true friendship between Wilbur and Charlotte.
In many ways, 'Holes' is realistic fiction. It incorporates themes and scenarios that have parallels in the real world, such as challenges, friendships, and the impact of circumstances on individuals. However, it might have some fictional enhancements for narrative purposes.