You fund 401(k)s (and other types of defined contribution plans) with "pretax" dollars, meaning your contributions are taken from your paycheck before taxes are deducted. That means that if you fund a 401(k), you lower the amount of income you have to pay taxes on, which can soften the blow to your take-home pay. For example, if you put $100 into your 401(k) each month, your paychecks might only get smaller by about $60-$80 per month. (The exact amount will vary depending on your salary and tax bracket.)
So if you make a small contribution to a 401(k), or if you increase your contribution by 1% or so a year, chances are you'll hardly even notice the difference in your pay checks, and your tax bill will be lower.
You will have to pay taxes eventually of course, but not until you retire. The IRS taxes all withdrawals at your ordinary income tax rate.
But there's a catch: if you make withdrawals before age 59 ½, you typically have to pay a 10% early withdrawal penalty on top of any taxes due. That can take a huge chunk out of your nest egg, and is usually a bad idea.
There's also a type of 401(k) plan called the Roth 401(k), which offers a tax break that essentially acts as the reverse of the traditional 401(k): You do have to pay tax on your contributions, but you won't have to pay any tax when you withdraw the money in retirement. So all the money in your account grows tax free.