The IRS normally places a federal tax lien on your 401k prior to taking any further action. This establishes the fact that the IRS is owed money. The IRS then issues a notice of intent to levy and finally a notice of levy on the 401k plan. The IRS will collect any and all funds from your 401k plan in order to satisfy a tax debt you owe.
The IRS represents the exception to the 401k plan protections offered under the Employee Retirement Income Security Act, called ERISA. The IRS is allowed to take any money to satisfy a tax liability that has been unpaid by you. However, the IRS may not immediately place a tax lien or levy on your account. Instead, you are given the option of paying your tax debt prior to any IRS action.
Once the IRS has placed a notice of intent to levy on your account, you still have time to prevent collection action. However, you must act quickly. You may contact a tax attorney or the IRS directly to negotiate a payment arrangement. The IRS may set up a payment arrangement with you. If they accept your offer for a payment arrangement, collection action will stop and your 401k account will not be levied.
If you fail to make the required payments to the IRS under the payment arrangement, then the IRS may resume collection action. If this happens, you may not be able to negotiate further payment plans with the IRS. For this reason, it's important that you strictly follow any payment arrangements that are set up with the IRS to avoid a forced liquidation of your retirement account.