In my 401k there is a Bond index fund that I have been putting 20% in. My goal is to have an 80/20 asset allocations. Would I be better off going 100% in stocks for 401k and get my 20% outside the retirement account using treasuries and CD’s? Also are Bond fonds in general not that safe.
People generally hold bonds/bond funds for two reasons
1. As an uncorrelated asset to stocks. For this purpose, many people use bond funds. As an uncorrelated asset, it can smooth out the year-to-year volatility vs, holding 100% equities. Depending on the percentage of bonds chosen, the amount of smoothing will of course vary, along with the associated reduction in long term returns of a portfolio. In the very short term it
can go become anti-correlated, such as 2008/09. But bond funds could just as easily be (and have been) correlated to stocks during times of financial stress, especially when considering inflation. As others have mentioned, most index bond funds target a very specific average maturity - meaning that they're buying and selling bonds before maturity all the time. Number of years maturity, years remaining till maturity, interest rate at the time of purchase, and interest rate of any new bond it replaces all go into factoring the NAV of a bond fund at any given time.
2. As a source of income. For this purpose, many people purchase individual bonds and hold them to maturity where they have 100% knowledge of the nominal returns along the way, if holding nominal bonds. If, at any point, one decides to sell before maturity, then the same forces at work in a bond fund will apply here. Likewise, if one is purchasing an already existing bond from somebody. If the money isn't needed at maturity, people often build a bond ladder and use the proceeds to purchase new bonds that mature N years in the future - rinse and repeat. Plenty of sources out there on how to build a bond ladder.
As far as bond "safety", the answer is "it depends".
Treasury bonds are backed by the full faith and credit of the US government. You or a mutual fund buys a treasury bond, then the return is known and guaranteed. That doesn't mean that market forces as I described above won't move the value around if holding a bond fund or if you want to sell a bond early. Corporate and Municipal bonds can't make that claim.
Then there is inflation. When you buy a nominal bond, the interest rate is set for the life of the bond. If inflation rears its ugly head, as it did in the 1970's, then you could easily lose money, in an inflation adjusted sense. They didn't exist back then, but TIPs and Ibonds fill a roll for inflation protection, with the price of protection being that the interest rates are lower than nominal bonds during times of low/stable inflation.