Before answering the question, why contribute to your 401k, let's first answer the question, what is a 401k?
A 401k is a retirement savings plan with associated tax benefits offered by your employer. A 401k is an account into which you, principally, and your employer (perhaps) secondarily both contribute.
The money that you contribute is always yours and can never be forfeited due to a change in your employment status. You can, however, lose money on investments, but leaving your job won't cause you to lose your hard earned money.
There are two types of 401k accounts, "traditional" and "Roth." Many, but not all, employers offer both.
Traditional
Traditional 401k accounts offer a tax deduction for contributions. Withdrawals will be taxed when withdrawn during retirement.
Roth
Roth 401k accounts do not offer a tax deduction for contributions, but the withdrawals during retirement are not taxed at all.
While many people get excited about the idea of the Roth - no income tax during retirement - the value of that difference is limited to the difference in tax rate between now and retirement. If you have low enough income - or enough children - that you pay little or no tax on your income now, then it makes perfect sense for you to contribute to the Roth type account. If you have high income as some do at the pinnacle of their careers, it may make more sense to contribute to a traditional account to shelter income in the high tax year and pay tax in retirement when income may drop you into a lower tax bracket.
The key reason to contribute to your 401k, regardless of which account type you choose, is to save money for your retirement. Investment returns for the current generation are likely to be lower than for the last generation, meaning that we'll need to invest more than our parents to have the same sort of retirement. More than ever, we need the benefit of what the finance world calls "compound returns." That simply means, we need the benefit of the interest on the interest piling up over the years to provide for our retirement.
The secondary reason to contribute to your 401k is that your employer is probably going to contribute to the account. If you contribute $1,000 this year, your employer will likely give you another $500 to $1,000 as well. The money contributed by your employer is typically subject to vesting, meaning that if you leave within a defined period of time, you'll lose the money the company contributed on your behalf and the earnings on it. Still, that means you could get a raise just for making a contribution to your 401k - which you should do anyway. It's basically free money. Never pass up free money!