Answer:
It explains to the reader that Elya was indeed Stanley's great-great-grandfather.
Step-by-step explanation:
The story "Holes" by Louis Sachar tells the story of how a curse by a 'witch' led to the misfortune of the victim's family throughout his generations. Stanley Yelnats' grandfather Elya Yelnats did not keep his promise to the gypsy Madame Zeroni, which led to the unfortunate life of his great-great-grandson Stanley.
In chapter 7, the author includes the family history of Stanley and narrates how the 'misfortune' of being 'cursed' by the gypsy follows the Yelnats family. He included the line "He didn't know he was Stanley's great-great-grandfather" to make the point clear that Elya was indeed his great-great-grandfather who was a "no-good-dirty-rotten-pig-stealing-great-great-grandfather".
Thus, the correct answer is the second option.