At expiration, all futures contracts go through a settlement process to keep prices in line with the spot market. This process can be physical or cash-settled.
Settlement is the fulfillment of the legal delivery obligations associated with the original contract.
Every futures contract has an expiration date, after which the contract will go into the settlement period.
Generally speaking, equity and treasury market products are cash-settled, where settlement in the form of a credit or debit in the amount of the contract is made within the trading account holding it.
For example, in the case of a micro e-mini S&P contract, if the December 2023 contract expired at 4813.00 and you were short one contract from 4816.00, your trading account would be credited $15 ($1.25 per tick, 4 ticks per point, 3 point movement).
If you were long one contract from 4816.00 and the contract settled at 4813 your trading account would be debited $15.
Commodity products are generally physically settled, with the buyer or the seller required to make or take physical delivery of the specified number of contracts at one of the delivery points outlined in the contract specs. In the case of corn, for example, this would be 5000 bushels of corn for each contract.
The settlement structure for each product is outlined in the contract specs, but trust us when we say you don't want to go into settlement procedures long or short a commodity contract!