You shall not abhor an Egyptian, for you were a sojourner in his land. The sons that are born to them, their third generation may come into the LORD’s assembly. The reason the third generation is able to come into the LORD’s assembly, Hizkuni explains through the verse that instructs us to retell the story of Exodus: in the ears of your son and your son’s son. Up to the third generation values are embedded, if not through instruction then by osmosis, after this point the slate is clean and a new generation can rise up.