Good question, Jannett. If you have a 401k balance when you die, it will become part of your estate and the named beneficiary will be entitled to receive the account proceeds. Often times the plan will distribute the proceeds to the beneficiary as a lump sum distribution, subject to ordinary income tax. Whether or not such a distribution is mandatory depends upon the terms of the plan.
If your spouse is the beneficiary of your account, they will be entitled to roll over the lump sum distribution to an IRA, thereby deferring the income tax liability. If the value of your estate is greater than the lifetime exclusion amount, your 401k plan will also be subject to estate tax. If you are in this category, you should consult with a financial advisor or an estate planning attorney to determine whether there may be tax mitigation strategies available to you.