The yield curve shows the relation between the (level of) interest rate (or cost of borrowing) and the time to maturity. How the rate of return (say measured in terms of interest rate) changes with time (say, years) of investment.
Investing for a period of time t gives a yield Y(t). This shows that yield is related with time or is a function of time. This function Y is called the yield curve, and it is often, but not always, an increasing function of t. Higher yield shows that higher interest rate should be given for borrowing. Usually, higher yield is offered for a security to attract investors to make investment overtaking risk.
Normal yield curve
Yield curves are usually upward sloping; the longer the maturity, the higher will be the yield (interest rate offered). Higher the period for which you invest in a security, higher will be the yield (or rate of interest). But for increasing number of years, the increase in yield (interest rate) will be small. This means that the curve flattens out for higher maturity. A normal yield curve shows normal economic conditions generally. But at the same time, higher yield or rate of interest indicate that cost of borrowing is higher.
Importance of government bond and its yield in understanding economic situations
On which type of securities we can observe the trend in yield curve for a country? Here comes the importance of government bonds. Government is a very creditworthy borrower and a big borrower as well. Hence the yield curve of government bonds is taken as standard mirror explanation about current economic conditions.
The upward sloping yield curve is the normal yield curve which shows you will get higher interest rate if you invest in a long term bond. This is a typical yield curve that is shown in the diagram attached here. But yield curve need not be upward sloping always. There are exceptions. The exceptions are flat yield curves and downward sloping yield curves as well.
Flat yield curve
In the case of a flat yield curve, there is no difference between short term interest rate and long term interest rates. Or in other words, interest rate will be the same if you invest for a short time or for a long time.
Inverted yield curve
If there is negative relationship between interest rate and maturity period of a bond, the yield curve will be negative sloping. This is called inverted yield curve. Here, you get higher interest rate for short term investment. This type of inverted yield curve shows that economy is in some sort of a crisis now. because of the bad economic conditions now, you will get higher interest rate to cover the risk you are facing. But in the long term, interest rate (yield) decreases, indicating that the economy will come back to normalcy in the long term.