The second line is regularly quoted as a promise of wealth transfer, which is not what a proverb of this kind is doing.
Quick answer
A good life plans past its own lifetime. The second line observes that ill-gotten wealth tends not to stay where it was gathered, and it is not a mechanism anyone can invoke.
Read both lines
The first line is the verse's actual subject, and its horizon is the striking part: not children but grandchildren, people the man will likely never meet. That is a description of a life lived on a long timeline, which is what an inheritance is. The second line then observes something the book says in several places, that wealth accumulated wrongly has a way of ending up elsewhere. Ecclesiastes makes the same observation and calls the whole business vanity and grasping for the wind (2:26), which is a useful check on how triumphantly the line should be read.
What it does not mean
This is not a promise that a believer will receive a transfer of anyone's money, and it should never be used to raise funds, justify a claim on someone's estate, or teach that wealth will change hands on schedule. Proverbs observes how life generally runs; it does not sign contracts, and this book refuses the transfer-jackpot reading everywhere it touches money. It warns against wearing yourself out to get rich because wealth flies away (23:4–5), asks for neither poverty nor riches (30:8–9), and says plainly that food goes to waste in the fields of the poor for lack of justice (13:23, two verses from here). Read as a mechanism, the verse turns the gospel into a scheme. Read as this book reads it, it says a well-lived life tends to leave something behind and a badly-gotten fortune tends not to.
Related: Proverbs 23:4–5 · Proverbs 30:8–9 · Ecclesiastes 2:26 · Proverbs 13:23
New King James Version®, Copyright © 1982, Thomas Nelson. All rights reserved. Full copyright information. Scripture provided by API.Bible.
Go Deeper
If this verse has been used to put weight on you that it was never carrying, ask about it directly.