When someone dies who has been receiving Social Security benefits, two different things might happen based on the person's earnings record and Social Security tax payments. The first is that
if there is a surviving spouse or a surviving child under age 18, the surviving spouse and any qualifying children become eligible for what are called Social Security survivors benefits. A surviving spouse may be eligible for these benefits as early as age 60. The benefit amount is the same as the deceased spouse's retirement benefits were (though it's reduced if the surviving spouse claims the benefits before reaching full retirement age, which is now 66 for most people). Someone who is eligible for survivors benefits and also retirement or disability benefits based on their own work record may not collect both -- they are entitled to collect whichever benefit is higher.
Survivors age 60 and above who qualify for survivors benefits may collect them for as long as they live. Survivors benefits may also be paid to a surviving spouse at any age who is caring for the deceased worker's child, until that child reaches age 16. As with retirement and dependents benefits, if a surviving spouse collects survivors benefits before he or she has reached full retirement age, the amount of those benefits may be reduced if the surviving spouse has earnings from current work. To find out about these and other eligibility rules, visit the Social Security Administration survivors benefits web pages.
If the person who dies has no surviving spouse or children who qualify for Social Security survivors benefits, the money the deceased person and his or her employers have paid in during the person's working years remains in the Social Security trust fund. It cannot be paid to any survivors or heirs who do not qualify under the Social Security survivors benefits eligibility rules. That is because Social Security taxes do not "belong" to the person who pays them but to the Social Security system as a whole. Social Security taxes go into a general Social Security fund from which people are provided benefits regardless of whether the amount they personally paid into the system is enough to cover the benefits they collect over a lifetime. In other words, some people will pay into the Social Security system for a long time but collect benefits for only a short time (or not at all), while other people collect benefits for a very long time even though they only paid into the Social Security fund for a relatively short time. The only way this can balance out for the society as a whole -- remember, this is called "Social" security -- is if all amounts paid into the fund by way of taxes remain in the fund, to be distributed based on a system that tries to protect as many people as possible.