401k is merely a sub-section of the Internal Revenue Code. 401K plans started around 1978. It is NOT magic; but,...it IS perhaps, the ONLY, REASONABLE, advantage/ break, a wage earner,(working stiff), has ever been allowed by the IRS !
Many of it's intricate regs. and rules have been pointed out, and, first and foremost O P, your "4 %" question was answered.
A company that has a "401K" plan is doing both of you a favor. Them, because they no longer have to offer a "defined pension plan" in order to attract first rate help.
You; because the amount of contribution you make is, first of all, deducted from your April 15 tax burden. The company also is only required to make their portion of the contribution quarterly, so smaller companies have some operating capital that uncle sam stays out of.
The rule once was, a company must have nine full time employees, (that participate) in order to have a 401K plan. That may be changed now.
If a company, (not all do anymore), matches any portion of your contribution, that is "gravy". It earns the same as your contribution, going tax free until you have to begin taking a " R M D" in the year you turn 70 1/2.
The idea was, most people by the age of 70 1/2 would no longer be high earners, and would be at the lowest tax-rate of their lives, so RMD withdrawals, which are taxed as ordinary earned income would be a bargain, compared to the tax-rate you would have paid at peak earnings years.
A caution here. If you decide to NOT take any or all of the "RMD", there is a 50% penalty on the un-taken amount.
As pointed out by several here, some people, have managed to be earning more taxable income at 70 1/2 than ever before, thus, the advantage of the 401K seems to be lessened.
Not So..... The many years of lowered tax burdens have to be taken into account. The "flaw" of 401K as I see it, (the only one ! ) has to do with the ever rising age of full retirement Social Security age. While at the old age grouping of 65, you had 5 1/2 years before RMD. Now it is about 3 1/2 or 4.
Granted, for a worker with V P behind their name, a six-line phone system on their desk, internet access, and some of the "on job personal time" allowed by those arrangements, certainly there could be a higher return investment portfolio.
But, by and large, my advice would be two-fold. Make the largest contribution you can, and keep at least half your plan choices in a stable fund. Right now; perhaps more than half.
I will add, that most every one notes the 59 1/2 age as the point you can begin to withdraw with no penalty.
Most all plans now allow several situations where you can take some of your money and pay it back to the plan with a minimal "make-up" percentage of 1 or 2 percent, over and above the agreed upon "pay-back" amount for handling fees and such.
This ""fee" will not be added to the grand total of your 401K.
Also, major medical problems, first time home buyers, and college funds for your offspring,(or you), all can be taken with no penalty. Normal earned income taxes yes, but no further penalty.
One little oddity hardly ever mentioned. IF, you note ANYONE other than your spouse as a beneficiary, they, the spouse, must agree in writing.
This may have changed in recent years, seeing as the whole concept of "spouse" has changed, but some states have special consideration for "spouses" in regards to a 401K plan. (We now head into "inheritance land", which is more mysterious than 401K.
Finally, while 59 1/2 is considered the age when 401K / IRA money can be taken with no penalty, actually, you can start taking 401K plan money at age 55; provided you declare full retirement, and state an EXACT amount per month,(every month till age 59 1/2) you wish to take.
If the amount is too little to live on; tough. If it turns out to be an overage ? well you can save it, but at this point, you are declared "full retirement", and can no longer contribute, (or put back), money into your 401K.
Mostly, I expect people, (working people) that retire at age 55, fully expect to get back into the work force someday. Perhaps they were offered a nice "package" to retire, or were just tired of the "rat-race", so not many folks likely take this route.
401K plans are for "wage earners" only, so if you are retired, no wages, there is no way to re-start contributions.
That "age 55 retired" can not be changed again until age 59 1/2, when you will revert back to "regular" status.
I say again. It is one of the few things the gobment ever did that has no major drawbacks for a wage earner. Put in all you can as soon as you can.