Having designed and worked in Refineries before, I think, even if we “owned” all the oil wells (onshore and offshore), this is not practical because of the economics. It takes less capital and operating costs to bring in and refine crude at a central location.
This page (http://www.eia.doe.gov/kids/non-renewable/refinery.html) gives a layman’s introduction to refining.
Refining provides a whole lot of feedstocks for downstream processing. A few examples may be ethylene (for making polyethylene), propylene (polypropelene), Naphtha (Either Naphtha or Natural Gas is used to make Hydrogen, which is in turn used to make Ammonia which is inturn used to make Urea or associated fertilizers, Benzene/Toluene/Xylene Aromatics - for polymers and pharma … There are a range of products from pharmaceuticals and cosmetics, to fuels and polymers feedstocks which are catered to by the refinery.
The biggest unit in the Refinery is the CDU (Crude Distillation Unit) which is the originator of all products followed by the Vacuum Distillation Unit (VDU). These just do separtions whereas units following this have reactions happening in them (hydrogenation, aromatization, alkylation, …).
Refineries generate products depending on the demand. It can be shifted to generate more gasoline or more diesel with the same amount of crude.
A very important factor with crudes is their sourness (sulfur content). Sulfur is a big problem - not only because of pollution problems, but also due to corrosion and catalyst poisoning. Hence, a crude with higher sulfur content will need the refinery to make changes before it can accept it.
Another important factor may be safety. Downstream petrochemical plants are located near the refineries for safe transportation requirements. Once you make ethylene in a refinery, you have to liquify it (@ -104 °C) to transport it over long distances. And hydrogen is most dangerous to transport.
Even NASA (Florida) has a big problem getting their 100 odd tons of Hydrogen from New Orleans.
Thats more info than desired, I guess :).