What happens when a Futures contract expires?

Stock Future contracts are physically settled by the broker on the expiry, where the buyer takes the delivery and the seller has to give the delivery of the underlying security. Index Futures on the other hand do not involve any delivery of shares and are squared off at the market price and the Profit or loss is adjusted in the cash account of the individual.

Futures Contract -

A Future contract is a legal contract between the buyer and the seller to exchange the underlying security at the pre-determined price on the date of expiry. Unlike Options, Future contracts do not expire worthless, instead of on the Expiry day, if the Future positions are not squared off by the particular individual then the orders are matched with Buyers/Sellers, and the underlying securities are exchanged.

For example,- If you are Long on Reliance Industries Futures on the day of Expiry then the Broker will automatically match your order with another Seller and you will have to take the Delivery of 1 Lot of Reliance Industries by paying the remaining Money.
On the contrary, if one is Short on a Futures contract on the day of expiry then one will have to give Delivery of the underlying security to the buyer at the pre-determined price. In this way, the Stock Future Contracts are settled on the date of Expiry. Whereas in Index Futures there is no delivery involved and the position is just squared off and the Profit or loss is adjusted in the Cash account of the individual.