That is the hard lesson learned by the three adult children of a wealthy telemarketing executive who died suddenly last month. His will states that all his assets are to go to his children, according to Laura Mattia, a principal at Baron Financial Group, a financial-advisory firm in Fair Lawn, N.J., who was consulted after the executive’s death by his estate attorney.

However, much of his wealth was in his 401(k) retirement account, and the fate of those assets isn’t dictated by wills.

It is a little-understood situation: After a lifetime of saving, what ultimately happens to your individual retirement account, 401(k) and other retirement savings often hinges on what you scribbled down, decades earlier, as you filled out a form designating your beneficiaries.

If you haven’t updated that paperwork to reflect how your life has changed, you might not be able to leave your wealth to your heirs as you wish. Instead, you could bequeath them a bureaucratic nightmare.

The executive who died last month, Ms. Mattia says, should have asked his wife to sign a waiver and then named his children as the beneficiaries of his 401(k). Because he didn’t, his wife inherits it—although he married her only two months before he died. By neglecting to update his beneficiary form, the executive effectively disinherited his children.

No wonder Stewart Sterk and Melanie B. Leslie of the Benjamin N. Cardozo School of Law at Yeshiva University in New York call retirement accounts “substitute wills.” In a study they have just published on the problem, the law professors point out that most Americans believe their retirement savings will be divided according to the instructions in their will—like their other assets. In fact, who inherits retirement money is usually determined by the language on beneficiary-designation forms that many people have long since forgotten or lost.

Among the pitfalls are designating your parents as your beneficiaries while you are still single and failing to update the form when you marry, and naming your children but not stipulating that the money should go to your grandchildren if any of your children die before you.

If you mistakenly leave a former spouse designated as a beneficiary of your 401(k), he or she will generally be entitled to the assets upon your death—even if those assets were excluded from the divorce settlement.

“The system works fine most of the time, getting people the money quickly and cheaply,” Prof. Sterk says. “The problem is it comes at a huge cost in the minority of cases.”

Lauren Lindsay, director of financial planning at Personal Financial Advisors in Covington, La., once worked with an insurance executive who had four children. He gave one child so much money to fund her own business that he told all the children (including her) that it would be unfair to give her anything more.

He informed Ms. Lindsay that he would be changing the beneficiary-designation forms on his retirement accounts so his other three children would inherit them exclusively. Before he could complete the paperwork, he died in a car accident, leaving his prodigal daughter with title to 25% of his retirement assets.

F. Dennis De Stefano of De Stefano Wealth Management in Kihei, Hawaii, had a client who named her live-in boyfriend as a beneficiary of her IRA. She later moved away and married another man. As she lay dying of cancer, her husband tried to get the beneficiary form revised, but she was no longer mentally competent to make the change.

The husband “was frustrated as heck by the trauma and heartache of trying to get it corrected,” Mr. De Stefano says.

Kevin Reardon of Shakespeare Wealth Management in Pewaukee, Wis., points out that if your adult child dies before you and you don’t change your beneficiary forms, that child’s heirs will typically be cut out of any bequest you mean to give them. Your retirement assets will be divided among your other children—cutting off one branch of your family.

That wouldn’t be what you directed in your will. Virtually every state has laws requiring that wills be written to ensure that your grandchildren will automatically become your direct heirs if your children die first.

However, Profs. Sterk and Leslie found that only five of 20 forms from top retirement firms expressly offer that option. Many forms don’t even allow you to name more than two primary beneficiaries.

It is high time that retirement firms overhaul these rigid and antiquated forms. Until they do, you are overdue to check up on how you checked those boxes so long ago.