If we wanted to "buy the IBEX", we would have to buy each and every one of the 35 companies that make it up, and also adjust the weight that each one has in the index. However, there are simpler and more straightforward ways to do this. We can do this through an ETF that replicates the index, or a future whose underlying asset is the IBEX.
As one Ibex 35 futures contract is equivalent to €10/point (multiplier), this contract will cost €10,500, but in reality we will be taking a position for €105,000. However, it will not be necessary to deposit the €105,000 to take the position, but only the collateral required at that time (leverage).
From the moment we have our position, by having bought an IBEX 35 future, for example, we will be exposed to market movements.
Assume that on the first day, the contract closes at €10,650. The gains and losses for the day will be settled and we will be credited with €1,500 (150 points times €10 multiplier per point).
The next day, the contract closes at €10,550, and therefore, at the close of the day, the corresponding loss (€10,650 - €10,550) of €1,000 is deducted.
And on the third day, which coincides with the maturity, there is a big rise, and the future is settled at 11,000 points. On that day we would be credited with the profit for that day of (11,000 - 10,550) €4,500. However, our accrued profit would be €5,000 as we opened the position when the contract was trading at 10,500.
In other words, when we trade a futures contract, we lock in the price at which we want to hold it in the future, and the result (gain or loss) will be the settlement or closing price of the position against the price at which we opened the position.