Germany in 1939 relied on sea trade for many essential war supplies. Oil had to be imported from the US and other countries by ship. Germany was also not self-sufficient in food supplies and other goods.
Britain's declaration of war against Germany in September 1939 meant that Germany was blockaded by the Royal Navy. There was no realistic prospect of challenging the Royal Navy in open battle, and Germany could not break the blockade. Germany's pre-war stockpile of oil was diminishing. The only remaining major market open to Germany was the USSR.
It was this situation that prompted Hitler to invade the USSR. Germany was completely reliant on Soviet supplies of oil and other essentials due to the blockade. This put Stalin in a position where he could potentially cripple Germany simply by shutting off supply lines. To Hitler, this was an unacceptable risk. By the time Barbarossa was launched in June 1941, it was estimated that Germany had sufficient oil reserves to continue the war for three months.
Conquest in France and the USSR combined with synthetic oil production and an all out extraction of oil from Romania allowed Germany to drag out the war for longer, but there was never enough oil. It is the reason why in 1942 Germany did not attempt to take Moscow but instead launched Fall Blau towards Stalingrad and the oil fields of the Caucasus. And it is one of the main reasons why the sixth army could not be supplied at Stalingrad.
Did Germany lose the war in September 1939, by getting into a war against Britain which Germany could not win? It seems to me that every step of the war from here on (war against USSR, declaring war on the USA) stems from the original miscalculation in September 1939.
What do you think? Was Germany's defeat inevitable from the start?