Ignoring the complexities of a standardised and regulated market, a futures contract is simply a contract that requires party A to buy a given amount of a commodity from party B at a specified price. The future can be over something tangible like pork bellies or oil, in which case there is a physical transfer of "stuff" or it can be over something intangible like shares.
The purpose of the contract is to allow the seller to "lock-in" a price so that they are not subject to price fluctuations between the date the contract is entered and the date it is complete; this risk is transferred to the seller who will therefore generally pay a discounted rate from the spot price on the original day.
In many cases, the buyer actually wants the "stuff"; futures contracts between farmers and manufacturers being one example. The farmer who is growing, say, wool will enter a contract to supply 3000kg at $10 per kg (of a given quality etc. there are generally price adjustments detailed for varying quality) with a textile manufacturer to be delivered in 6 months. The spot price today may be $11 - the farmer gives up $1 now to shift the risk of price fluctuations to the manufacturer. When the strike date rolls around the farmer delivers the 3000kg and takes the money - if he has failed to grow at least 3000kg then he must buy it from someone or trigger whatever the penalty clauses in the contract are.
For futures over shares and other securities the principle is exactly the same. Say the contract is for 1000 shares of XYZ stock. Party A agrees to sell these for $10 each on a given day to party B. When that day rolls around party A transfers the shares and gets the money. Party A may have owned the shares all along, may have bought them before the settlement day or, if push comes to shove, must buy them on the day of settlement. Notwithstanding when they bought them, if they paid less than $10 they make a profit if they pay more they make a loss.
Generally speaking, you can't settle a futures contract with another futures contract - you have to deliver up what you promised - be it wool or shares.