Farmers set the prices, the same as shoppers at the grocery do.
First, you will sell to the elevator/feed lot/packing house that is offering the most money. If none of them do, you grow a different crop, or take other measures. That has an effect on prices. For example, lets say that the elevators are not offering enough for corn. A few farmers stop growing corn, this lowers the available supply. Each elevator is responsible to their customers and needs to supply them with corn. This starts a bidding war amongst them for the corn that is available.
The same with oil. There are a few pressures here. First is the supplier. OPEC manipulates the market by limiting supply. The US limits drilling for environmental reasons. The cold winter limits Russia's drilling. Iraq is producing effectively nothing. All of these factors reduce supply.
Then, China has QUADRUPLED their use in the last 5 years. That, along with increases in other developing nations like India and Pakistan, increases demand.
Speculators, attempting to stay ahead of the curve, are trying to buy and hold oil in an attempt to make money off of the rising prices. The speculators are- us. Our retirement funds. Our mutual funds. Other investment houses.
Add in the fact that governments further manipulate the market with taxes and fees, and you see that this is going to get worse, not better, with government interference. Nationalization, which at least one official has proposed, will also do more harm than good, for a host of reasons that will make this post even longer.