Proverbs 13:22-23 “A good person leaves an inheritance for his grandchildren, but the wealth of a sinner is stored up for the righteous. Abundant food may come from the field of the poor, but it is swept away by injustice.”
There are multiple ways these proverbs could be understood. The first proverb probably isn’t simply referring to the idea that we should make sure that we leave something for our children. The principle behind it is probably the idea of industry again. If you work hard, all things being equal, you’ll do well and end up leaving an inheritance. Those that don’t work, or perhaps engage in illicit activities, won’t have anything to leave behind, or will end up with what they do have being taken away.
Unfortunately, all things are not equal. A poor person could work hard, be righteous, and someone could come along who is unjust and take it all away. That’s why proverbs are probabilities. They even warn us that things don’t always work out in this life.
An alternative view is that, if you work hard, you end up with abundant food. However, the evil person may find that God takes his away. And, as part of the retribution, God gives it to those who are righteous.
Finally, there may also be a spiritual component at work here. A good person leaves a moral inheritance to their children and grandchildren. An evil person doesn’t, and the lessons that are supposed to be learned by their offspring are never learned. That “inheritance” of learning goes to the offspring of the righteous!