The opposite market condition to contango is known as backwardation. "A market is 'in backwardation' when the futures price is below the spot price for a particular commodity. This is favorable for investors who have long positions since they want the futures price to rise to the level of the current spot price."
The Commission of the European Communities (CEC & 2008 6) described backwardation and contango in relation to futures prices: "The futures price may be either higher or lower than the spot price. When the spot price is higher than the futures price, the market is said to be in backwardation. It is often called 'normal backwardation' as the futures buyer is rewarded for risk he takes off the producer. If the spot price is lower than the futures price, the market is in contango."
The futures or forward curve would typically be upward sloping (i.e. "normal"), since contracts for further dates would typically trade at even higher prices. (The curves in question plot market prices for various contracts at different maturities—cf. term structure of interest rates) "In broad terms, backwardation reflects the majority market view that spot prices will move down, and contango that they will move up. Both situations allow speculators (non-commercial traders) to earn a profit."
A contango is normal for a non-perishable commodity that has a cost of carry. Such costs include warehousing fees and interest forgone on money tied up (or the time-value-of money, etc.), less income from leasing out the commodity if possible (e.g. gold). For perishable commodities, price differences between near and far delivery are not a contango. Different delivery dates are in effect entirely different commodities in this case, since fresh eggs today will not still be fresh in 6 months' time, 90-day treasury bills will have matured, etc.
The term originated in mid-19th century
The purpose was normally speculative. Settlement days were on a fixed schedule (such as fortnightly) and a speculative buyer did not have to take delivery and pay for stock until the following settlement day, and on that day could "carry over" their position to the next by paying the contango fee. This practice was common before 1930, but came to be used less and less, particularly after options were reintroduced in 1958. It was prevalent in some exchanges such as Bombay Stock Exchange (BSE) where it is still referred to as Badla. Futures trading based on defined lot sizes and fixed settlement dates has taken over in BSE to replace the forward trade, which involved flexible contracts.
This fee was similar in character to the present meaning of contango, i.e., future delivery costing more than immediate delivery, and the charge representing cost of carry to the holder.