They were formed mainly through the extreme tension in the Balkan region. Serbia wanted control over the Balkans and Slav people. So did Russia. So they joined together, both secretly hoping the other would back down so that they would get all the land instead of having to share it. However, Austro-Hungary also wanted control over the Balkans and Slavs. They allied with Germany after realising they would have strength in numbers. That was how the basis of the Alliances started.
Germany had taken Alsace and Lorraine from the French in 1870 and they had had disputes over land ever since. France wanted to get revenge. By 1914, France was already allied with Britain and Russia, and Germany was allied with Italy and Austria- Hungary.
After Franz Ferdinand was assassinated in June 1914, Austria-Hungary declared war on Serbia. Serbia asked their allies Russia for help. As Russia mobilised its army, Austria- Hungary asked THEIR allies Germany for help. Germany then declared war on Russia, and according to the Schlieffan Plan (a declaration of war made sometime beforehand by a guy called Schlieffan, funnily enough.) they had to also declare war on France. The Germans went through Belgium to France as they thought (also according to the Schlieffan Plan) that as Belgium was a small country they could just walk in and take over. However according to an agreement that said Britain had to protect Belgium, the Brits had to get involved.
Anyway back to the Naval Arms Race. It really began when France and Germany tried to take over the Port Of Agadier. Britain backed up the French and consequently forced the Germans to retreat back home. This really put the wind up the German officer Kaiser Wilhelm.
Kaiser Wilhelm tried to build the German’s navy because he always wanted since he was a little boy to have the most powerful navy in the world. He had always been very interested in ships and therefore had the knowledge to be a very powerful naval officer, which he eventually became.
As the Germans built up their navy, so the Brits had to aswell. They developed a super-ship, more heavily armed and armoured than anything that went before it. It was called the Dreadnought. The Germans then built equivalent ships and so a race to build the most began, The Naval Arms Race.
Britain maintained what was called The Two-Power Standard. This meant they wanted to have a navy twice the size of the next two biggest navies put together so that they were always able to protect themselves, as they were and island and so they only means of attack they could receive was by sea, air travel had not yet been invented. Germany said they didn’t need a bigger navy than Britain, just one big enough to threaten them.
Historians today have reason to believe that Germany had been planning to start a war long before WWI actually started in 1914, as the Schlieffan Plan was made a long while beforehand. This meant that the Germans should have had the upper hand, but because they had no idea about the extent of the British army they were dragged down quite considerably.
In conclusion, they Alliance system and the rivalries between most of Europe were the most important causes of the outbreak of WWI. The Naval Arms Race, although it was an important cause, was probably not enough on its own to cause the war. Maybe the Germans lost this because the British had the advantage. Britain had 29 potentially Dreadnought-class ships by 1914, compared to Germany’s 17. Also, Britain had the more experienced navy and officers.