The main causes of world war 1 are:
An easy way to remember the long term causes of WWI is this:
As the world entered the 20th century, an arms race had begun. By 1914, Germany had the greatest increase in military buildup. Great Britain and Germany both greatly increased their navies in this time period. Further, in Germany and Russia particularly, the military establishment began to have a greater influence on public policy. This increase in militarism helped push the countries involved to war.
An alliance is an agreement made between two or more countries to give each other help if it is needed. When an alliance is signed, those countries become known as Allies.
A number of alliances had been signed by countries between the years 1879 and 1914. These were important because they meant that some countries had no option but to declare war if one of their allies declared war first.
Imperialism is when a country takes over new lands or countries and makes them subject to their rule. By 1900, the British Empire extended over five continents and France had control of large areas of Africa. With the rise of industrialism, countries needed new markets. The amount of lands 'owned' by Britain and France increased the rivalry with Germany who had entered the scramble to acquire colonies late and only had small areas of Africa.
Nationalism means being a strong supporter of the rights and interests of one's country. The Congress of Vienna, held after Napoleon's exile to Elba, aimed to sort out problems in Europe. Delegates from Britain, Austria, Prussia and Russia (the winning allies) decided upon a new Europe that left both Germany and Italy as divided states. Strong nationalist elements led to the re-unification of Italy in 1861 and Germany in 1871. The settlement at the end of the Franco-Prussian war left France angry at the loss of Alsace-Lorraine to Germany and keen to regain their lost territory. Large areas of both Austria-Hungary and Serbia were home to differing nationalist groups, all of whom wanted freedom from the states in which they lived.
Basically the eurpoean countries were building up their arms and were suspiscious of each other because they were afraid that if their neighbor had more weapons than they did then they would have the upper hand. After the assassination of Ferdinand everything exploded from there.
Hope this helps!