Futures are a mechanism to transfer risk from one party to another, more or less.
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.