The large majority of the time, all else being equal, the longer the bonds held in a fund have until maturity, the higher the yield and income the fund generates will be. What you trade for higher yield is more volatility in the performance of the fund. This is what is known as interest rate risk.
To help demonstrate this point have a look at the performance comparison chart of the Vanguard Long-Term Bond Index Fund vs. the Vanguard Short-Term Bond Index Fund. As you can see the performance of the Long Term Fund was significantly more volatile than the performance of the short term fund.
Keep in mind that just because two bond funds are both in the the same category does not mean that they will have the same amount of interest rate risk. For example to be categorized as an intermediate term bond fund, the fund has to hold bonds with maturities between 5 and 12 years. This generally puts the duration of intermediate funds anywhere from around 4 years to around 9 years. Duration is a measure of interest rate risk, so a fund with a duration of 8 will have twice as much volatility as a fund with a duration of 4, even though both these funds could be intermediate term bond funds. (you can learn more about bond duration here)
Our opinion here at Learn Bonds is that the best balance between interest rate risk and return lies in the lower end of the intermediate term range of around 6 years.
(Note: The above chart shows that the long-term fund outperforms the short-term fund. While this is true during the last decade, if overall interest rates rise this may not be true for the next 10 years. What will be true, even if interest rates rise, is that the performance of the shorter-term fund will be a much smoother line and less volatile than the longer-term fund.)