In general economic theory, there are always two markets created based on a need for a good; a spot market (where people who need something now can go outbid other people who need the same thing), and a futures market (where people who know they will need something later can agree to buy it for a pre-approved price, even if the good in question doesn't exist yet, like a grain crop).
Options exist as a natural extension of the futures market. In a traditional future, you're obligated, by buying the contract, to execute it, for good or ill. If it turns out that you could have gotten a lower price when buying, or a higher price when selling, that's tough; you gave up the ability to say no in return for knowing, a month or three months or even a year in advance, the price you'll get to buy or sell this good that you know you need. Futures thus give both sides the ability to plan based on a known price, but that's their only risk-reduction mechanism.
Enter the option. You're the Coors Brewing Company, and you want to buy 50 tons of barley grain for delivery in December in order to brew up for the Super Bowl and other assorted sports parties. A co-op bellies up to close the deal. But, since you're Coors, you compete on price with Budweiser and Miller, and if you end up paying more than the grain's really worth, perhaps because of a mild wet fall and a bumper crop that the almanac predicts, then you're going to have a real bad time of it in January. You ask for the right to say "no" when the contract falls due, if the price you negotiate now is too high based on the spot price. The co-op now has a choice; for such a large shipment, if Coors decided to leave them holding the bag on the contract and instead bought it from them anyway on a depressed spot market, they could lose big if they were counting on getting the contract price and bought equipment or facilities on credit against it. To mitigate those losses, the co-op asks for an option price; basically, this is "insurance" on the contract, and the co-op will, in return for this fee (exactly how and when it's paid is also negotiable), agree to eat any future realized losses if Coors were to back out of the contract.
Like any insurance premium, the option price is nominally based on an outwardly simple formula: the probability of Coors "exercising" their option, times the losses the co-op would incur if that happened. Long-term, if these two figures are accurate, the co-op will break even by offering this price and Coors either taking the contract or exercising the option. However, coming up with accurate predictions of these two figures, such that the co-op (or anyone offering such a position) would indeed break even at least, is the stuff that keeps actuaries in business (and awake at night).