A 401(k) plan is an employer-sponsored retirement savings scheme. The employer will typically choose a finance company to run the plan, and together they will decide upon the precise regulations for the plan, which have to be within the IRS specified framework.
You, as the employee, will be given a number of investment options within the plan, these will typically certificates of deposits, mutual funds, and the employer's own stock (if publicly traded).
You contribute a part of your wages tax-free to the plan. You won't pay any taxes until you withdraw the money on retirement. If you take out any money before the age of 59½ there's a 10% penalty, except in the case of specified hardships.
In the more advantageous plans, the employer will also contribute regularly on your behalf, typically matching every $1 you add with 25 or 50 cents.
So in such a plan, if you paid tax at 28%, for every $1 you add to the plan, you would have $1.25 or $1.50 accumulating interest for you, instead of the 72 cents you'd have available to put in your own savings scheme.
If you change over jobs, you can either cash out the plan prematurely (in which case the money is taxed, and you have to pay an additional 10% penalty), leave the money in plan until retirement, or transfer the money directly to your own IRA.
When you retire you set up a payment schedule, to withdraw your funds from the plan. The withdrawals will be treated as income for tax purposes.
On your death, the remaining value of your fund forms part of your estate. The beneficiary can withdraw the remaining funds as a lump sum, or alternatively set up a new payment plan.