If your 401(k) is entirely in stocks, you could lose all your investments if the stock market crashes.
However, if your 401(k) is partially invested in stocks, that part may crash, but the rest may stay intact. Therefore, it is best to diversify your portfolio to protect yourself from economic downturns.