(Proverbs 13:21): "Evil pursues sinners" - evil shall pursue them, and their children, and their children's children, until the end of all generations. "But the righteous shall be repaid with good" - that He repays reward to them, and to their children, until the end of all generations. What is written after it? (Proverbs 13:22): "A good man leaves an inheritance to his children's children." From here you learn that he bequeaths good things to his children and to his children's children.
Evil Pursues Sinners and Good Rewards the Righteous for Generations
Midrash Mishlei 13:2
(משלי יג כא): "חטאים תרדף רעה" - תרדף רעה להם ולבניהם ולבני בניהם עד סוף כל הדורות. "ואת צדיקים ישלם טוב" - שישלם שכר להם ולבניהם עד סוף כל הדורות. מה כתיב אחריו - (משלי יג כב): "טוב ינחיל בני בנים". מכאן אתה למד, שמנחיל טובות לבניו ולבני בניו.