Of course, the futures margin is offset by cash.
Futures is essentially an option and delayed delivery right for two-way trading of commodity prices.
Let me make an analogy. You are optimistic about the rise of commodity A and spend a small part of its actual value (margin) to gain the right to buy (buy and open a position). In fact, you don't own it. When it rises to your psychological price, you transfer the trading right (sell the position). At this time, the price increase is your income except the handling fee. If the price falls, the liquidation will bear the loss. Buying and selling follows the corresponding time relationship, similar to physical transaction. If you are optimistic that the price of A will fall in the future, you can buy the right to fall (sell and open a position), and when it really falls, you can transfer the right to trade (buy and close a position). The decline in price, excluding transaction costs, is your income. This is equivalent to buying low and selling high. It's just that the time of buying and selling is reversed, selling first, then buying. This is why falling futures prices can also make money.
Looking at opening more positions, you can also choose not to open positions at maturity and choose physical delivery; Similarly, short orders can be delivered in kind if they are not sold.