Futures are a mechanism to transfer risk from one party to another, more or less.

To reduce net risk for both parties, at the expense of also reducing chances of windfalls.

To the farmer, futures mean no risk of having to sell when prices are low. To the buyer, futures mean no risk of having to buy when prices are high.

The farmer also gives up the chance of selling when prices are high, and the buyer gives up the chance of buying when prices are low.

The transfers go both ways, which is the magic.

You’re leaving out the speculators who usually end up assuming the risk of both the producer and buyer.