No they only caused the second one.
After the First World War Germany was forced to sign the Versailles Treaty and admit its "guilt" for causing the war. Germany may have been partly to blame but others were equally at fault. This was partly a reflection of the anger felt by the Entente Powers ("Allies") at how long and hard Germany had fought, and partly due to some things Germany did during the war which seemed barbaric.
Germany had waged "unrestricted submarine warfare" sinking ships without warning, by firing torpedoes from underwater, unseen. This was a violation of international law, which prescribed that warships were to order enemy cargo and passenger ships to heave to, and allow the persons on board to take to the lifeboats before sinking their vessel. Germany did this at first, but the British sent out what they called "Q-ships", which were cargo ships on which had been mounted heavy guns, which were concealed behind false sides of the ship or fake wooden cargo crates on deck. When subs surfaced and ordered the ship to heave to, they would stop and wait for the sub to get close. Then they would drop the false sides and open up on the sub. As the Germans realized this was being done, they ceased surfacing to warn their targets and shot first. Germany also declared the waters around Great Britain
a war zone, and threatened to sink any ships found in these waters, including those of neutral countries. Some neutral ships were sunk. The greatest outrage over Germany's submarine policy followed the sinking of the HMS Lusitania, a passenger ship, with over 1500 people killed, including 128 Americans. However, the Lusitania, a very fast ship, was actually officially an "auxiliary cruiser" of the British Royal Navy. This was not uncommon at the time - passenger ships were often built with government subsidies and were subject to being taken for naval service (perhaps as a troop transport) in the event of war. It was more than fifty years after the Lusitania sank that the British government admitted that the ship was carrying contraband in its cargo hold - millions of rounds of rifle ammunition and many thousands of tons of explosive guncotton, which may have detonated and helped cause the ship to go down. It sank in twenty minutes after being hit by a single torpedo. Survivors reported hearing and feeling two explosions though. Due to the international outrage over the sinking of the Lusitania Germany ceased "unrestricted submarine warfare" in 1915, but resumed it early in 1917. Germany knew this would probably bring the US into the war, but took a calculated gamble that they could starve Britain out of the war before the US could raise an army and make its weight felt in France.
Germany also introduced the use of poison gas to the battlefield.
Probably the worst thing Germany did was invade Belgium. Prussia had been one of four powers which signed a Treaty in 1837 guaranteeing the perpetual neutrality of Belgium. Prussia was one of the city-states later merged into Germany, and the Prussian Royal dynasty became the German Emperors, so the Treaty was binding on Germany. Great Britain was another signatory to the Treaty. When the Germans invaded Belgium, which they did to get around the French frontier defenses and across the border into France from Belgium, the British demanded they cease violating Belgian neutrality and adhere to their obligations under the Treaty. The German foreign minister scornfully called the Treaty "a scrap of paper". This was what brought Great Britain into the war, so as far as Britain is concerned, the Germans were certainly at fault.
The Germans pursued a policy of "schrecklichheit" in Belgium. This was literally "frightfulness". The cemeteries of Belgium are full of gravestones maked "Fusilee par les Alemans 1914" - shot by the Germans, 1914. These are civilian graves. They shot the priest in many towns, and a great many other civilians. This was to try to cow the populace into submission. They also completely burned a great many Belgian towns, such as the ancient university city of Louvain.
The British had a very effective propaganda machinery, with an office at Rockefeller Center
in New York City
, making sure the stories they wanted appeared in US newspapers. They made sure the details of the very real atrocities and ship sinkings mentioned above got wide publication, and also had large portions of the US population believing that the Germans were systematically raping Belgian nuns and boiling Belgian babies down and rendering them into soap.
The reasons Germany invaded Belgium had deep roots. Germany became united into a nation in the 1860s and this alarmed the French. The French promptly started a war with Germany, and lost it. Germany took the provinces of Alsace and Lorraine in the peace settlement, and France spent the next forty years burning for revenge. As part of their schemes to eventually revenge themselves on Germany, France made an alliance with Russia. This was a very odd alliance - Europe's biggest (and practically only) democracy allied with its most repressive monarchy. But it made the Germans feel "surrounded". Now, war with either France or Russia meant war with both. Therefore the Germany army staff had to plan for a two-front war. Russia was huge and had millions of troops, but it would take six weeks for the Russians to call up all the reserves and get everybody equipped and on trains to where they needed to be to begin fighting. So the Germans decided they must beat France quickly, before the Russians could fully mobilize, and then they could turn their entire attention to Russia. The plan they arrived at was to invade France by going through Belgium, in cynical disregard of their obligations under the 1837 Treaty. So the existence of the Franco-Russian Alliance helped bring Belgium and Great Britain into WWI.
Serbia was an independent nation. Serbian nationalism was in full flower. The Serbian Intelligence service backed an organization called "The Black Hand", whose members assassinated the heir to the Austrian throne and his wife. This naturally infuriated the Austrians, who nevertheless misled their Allies, the Germans, as to the steps they were taking to deal with the Serbs. This seems to have been mainly the work of the Austrian foreign minister. The Serbs should never have hoped to get away with this though. The Austrians made very harsh demands of Serbia.
It was at this point that Russia decided to meddle. Russia had no treaty or alliance with Serbia, but took the Serbs part. Russia considered itself "the mother of the slavs". Had Russia stayed out of it, there would have been no wider war at this time than a war between Austrian and Serbia. In other words, no First World War as we know it. Since Russia mobilized on Serbia's behalf, the Germans were obligated to mobilize on behalf of their ally, the Austrians. Since the Russians were the opponent this triggered the German war plan and caused the invasion of France and Belgium, which brought Britain into the war. So really, Russia and its meddling was a much bigger cause of the war than Germany. So was Serbia with its assassinating the heir of a neighboring empire with a population fifteen times its own. France's desire for revenge for a war they started and lost led to an alliance which indirectly caused Belgium and Britain to have to fight. The only blameless nations were probably Belgium and Britain.
Germany is much more culpable for starting WWII. But the motivation was partly due to the harsh terms imposed on Germany for its "guilt" as the "sole cause" of WWI.