A wise person considers that God knows even the souls that have died, even those who now are in hell. Sheol (the grave or realm of the dead) and Abaddon (the tormentous destiny of the wicked dead) are places God knows openly. What lies beyond our lives as mystery to us is clearly plain to God. Wisdom perceives and believes, and trusts God in this.
Yet, the point of this proverb is more than that God knows what lies beyond life. The point is God's breadth of understanding of humanity. He knows the dead and the living. He intimately knows each person's heart. He knows me... even my hidden thoughts which no human has ever shared.
It could be argued that death and hell exist because God knows our thoughts. Our hearts often are the deepest evidence of our depravity. But Proverbs invites us to know God's wisdom and be blessed, even as it provides commentary on the results of our wicked ways. There is then a grace given as God knows our hearts. By holding to His Word and trusting God through Christ in believing the gospel, I can be spared the worst consequences of death.