The majority of today's refineries were built by the "Majors" (in fact the original definition of "Major Oil & Gas Company" was "A company vertically integrated from exploration activities through marketing to final consumers". Originally that value chain was measured between lifting costs (plus overhead including exploration costs) and nozzle price at the petrol station. At any given time some segments would be very profitable and others would lose money, but the end-to-end margin was all that mattered (up until the mid 1970's). When I started in 1980, crude prices were VERY low, oil production was barely profitable, but since refinery feed stocks were so cheap and refined products relatively expensive, the refineries made boat loads of money. Today the opposite is true and wellhead prices are really high while refined products are actually VERY cheap (don't start with the idea that the pre-tax pump prices are high, in constant dollars they are lower than any time since WWII).
With the rise of the MBA in the late 1970's this model was thrown out the window. By 1985 the upstream operations side of the Major that I worked for would happily take a lower price to keep from selling to our sister downstream company (the paperwork that the sister company required of us was too onerous to continue, especially when they didn't require the same documentation from 3rd parties). We would sell to jobbers at a discount and the jobbers would sell to our sister company.
Today the vertical integration is mostly gone. Every business segment must succeed or fail on its own. At today's high crude prices the OP is quite correct that refining margins are really skinny. Add to that the fact that well over half of the world's refining capacity is more than 80 years old. They are getting tired, but the margins do not exist to build new multi-billion dollar plants. Silly government policies (like the U.S. export ban and the U.K. Frac'ing ban) are keeping crude prices very high. Other government policies (like the very high usage-tax rates in most of the world and the threat of price control) are keeping end-use prices very low. Not a lot of room in there for new capital investment. So the OP's list is mostly not the driving force:
[ul]
[li]An overproduction of oil products,
Crude oil prices don't seem to indicate that this is true[/li]
[li]A slowdown in the economy with low market demand,
Rate of increase in market demand has slowed in the last few years, but world demand is still increasing[/li]
[li]Technological advances in the automotive industry,
A bigger factor in the U.S. than in most of the world. The U.S. road use taxes are so much lower than Europe or Japan that we don't have nearly as much price sensitivity as I've seen elsewhere. If you are driving your vehicle 40,000 km/year technology is a much bigger deal than if you are driving it 15,000 km or less[/li]
[li]Appearance of electric motors,
A sideshow at best, not a factor in refinery profitability[/li]
[li]Greater environmental awareness.
Environmental regulations are raising costs in refineries, which cuts into thin margins, it is certainly a major factor in the cost of new plants (getting a permit through the environmental regulators takes decades)[/li]
[li]Unfair environmental requirements competition between EEC, USA, Eastern countries, Africa, Asian and Australia.
My practice is global and I have clients on every continent with a large city and I don't see much difference in environmental regulations from one place to the next. The Interwebz is everywhere. A country seen as "lagging" the world's environmental regulations tends to find the strictest rules and modify them for the current thinking which leapfrogs from the "bottom" of the pack to the "top" of the pack in one legislative session.[/li]
[/ul]
My estimate of the driving force is regulations that put barriers in the path of supply and demand. Crude price should be around $60 USD/bbl and pre-tax pump price should be around $8 USD/gallon (€1.69/L). Neither is going to happen so we will Limp along until you see a major refinery go bankrupt, or blow up and not be fixed (I think that if anyone proposes shutting down a major refinery the government will nationalize it and run it until it burns to the ground).
David Simpson, PE
MuleShoe Engineering
In questions of science, the authority of a thousand is not worth the humble reasoning of a single individual. —Galileo Galilei, Italian Physicist