In the US and other countries the state provides a public administrator or magistrate to determine how to find potential heirs, and review claims against the estate by people or entities claiming the assets. If a will is created, the deceased can pre-determine who gets the assets, like a charity, the church, a close friend, etc.
What Happens to Assets With No Next of Kin? – Legalzoom
If you don’t want to engage an attorney, there are “do it yourself will kits” available on-line. Make sure they are valid in your location.
Here’s what happens with your stuff after you die – Business Insider
Having a will is a good idea, unless you have very little or just don’t care. Between the Mortgage bank, creditors, and people who make claims against your assets, your worldly possessions may not go where you want. In the US, the courts usually assign a lawyer to manage the assets (in “surrogate” court) and determine where they should go. In many cases the state takes what is left into their general fund – if there are no heirs or claims against the estate.
This post authored by Alan Chenkin, President of the “First Bank of Dad”