Our Gemara on Amud Beis discusses the prohibition of the Egyptian convert. A regular Jewish person cannot marry into that family fit the first two generations. He may only marry into the third generation born after the conversion, as stated explicitly in Devarim 23:9.

We might wonder what is the significance of three generations? The Chizkuni (Op. Cit.) explains that it takes three generations to change the family culture. As we find the Torah describes the process of transmission of the story of the Exodus to son and grandson, but does not mention great grandson (Shemos 10:2). In a similar vein, the Gemara (Bava Basra 59a) tells us that if Torah is in a family for three generations, it is not easily disrupted. As it states in Koheles (4:12) a three-fold twine cannot be quickly broken.

According to researcher Dr. Michael Gurven, grandparents have a particular function in society of passing along culture by telling stories.  He studied the Tsimane in Amazonia, a community in the Amazon River basin who live the same as they always had, without much involvement of the secular world.  They have a tradition of stories and songs that preserve their culture and history.  However, he discovered that by far, the grandparents were the ones who told most of the stories and songs. 

“While only 5% of Tsimane aged 15 to 29 told stories, 44% of those aged 60 to 80 did. And the elders' most devoted audiences were their much younger kin. When the researchers asked where the Tsimane had heard stories, 84% of them came from older relatives other than parents, particularly grandparents.”

One idea to explain this phenomenon is known as the “Alternate Generation Theory”.  Which is that the children often learn practical matters, survival and safety, from their parents.  They are often sternly told various the “dos and don'ts” so they will stay safe and grow up. However, the stricter parental stance makes the children less receptive to softer ideas, such as cultural messages and the sometimes ambiguous and nuanced morality that stories can capture. Grandparents who are less occupied with the practical matters of life have this role in passing culture and values through less disciplnary and harsh means, such as story telling.

Source:

Grandparents: The Storytellers Who Bind Us; Grandparents may be uniquely designed to pass on the great stories of human culture

Gopnik, Alison . Wall Street Journal (Online) ; New York, N.Y. [New York, N.Y]29 Mar 2018: n/a.