Three factors:
The long term factors that lead to World War One (WWI) are extreme nationalism, alliance system and armament race.
Extreme nationalism refereed to the belief and actions to enhance national glory and the sense of identity, which caused the European nation to went into conflicts with one another for the sake of national interests. The idea of gaining glory through foreign expansion lead to mounting hostility between nations that eventually lead to war. Some examples of the extreme nationalism are that France desired to take revenge on Germany after the Franco -Prussian War and wanted to defeat the Germany, Russia promoted "Pan-Slavism" and Germany promoted "Pan-Germanism". Influenced by extreme nationalism, the European powers refused to compromise in economic and diplomatic affairs in order to avoid to avoid being viewed as the weak. It encouraged the powers to compete for national interest which finally led to the outbreak out of WWI.
Alliance system is also one of the long term factor that led to WWI as the countries became suspicious and hostile towards each other given the countries' secret cooperation with each other. It was originally to seek national security when Germany, Austria-Hungary and Italy first signed the Triple Alliance system. This had however led to the discontent of the other countries and became worried about their own safety. Britain, Russia and France then signed the Triple Entente to oppose the Triple Alliance. Not only did this caused long term distrust, it also expand the wars between nation to be a world-war as other countries would be dragged into the war once two countries was engaged in the was.
While armaments race encouraged European powers to increase their military expenditure consistently to expand their armies as well as improve their weapons, for instance, Germany carried out conscription in the late 19th century, also announced to double the number of warships which led to the military competition with Britain of the building of dreadnoughts(a kind of warship).
In one paragraph:
The long term factors that lead to WWI were extreme nationalism, alliance system and armament race. Extreme nationalism was the idea of gaining national glory through expansion. This led to aggression among nations which finally led to outbreak of WWI. Alliance system are alliances that countries formed to protect themselves where the member nations would also be engaged in the war once a nation was attacked, Armament race is the competition between nations of weapon making.
Chain of events:
It could be said that WWI stated to build up when the Triple Alliance was formed in 1882, where Germany, Austria-Hungary and Italy formed alliance, This led to future formation of Triple Entente.
The first significant conflict was the First Moroccan Crisis where Kaiser William was displeased with the arrangement according to the Anglo-French Entente Cordiale that Britain recognized French control over Morocco. To resolve the crisis, Western powers held a conference in Algeciras in Spain. Among the participants, Austria-Hungary was the only nation that supported Germany. This stemmed Germany's discontent towards the other nations as Morocco, although not controlled directly by France, fell under the French sphere of influence. Germany's support towards Austria-Hungary also led to the later events directly leading to the outbreak of WWI.
Later in the 1908, Bosnian Crisis broke out as the Ottoman Empire was unable to suppress minorities' nationalism in the Balkan Peninsular. Austria-Hungary took advantage of the situation and annexed Bosnia and Herzegovina. The annexation caused Serbia to be unhappy about it. This stemmed the hostility between the two nations which ultimately directly lead to the outbreak of WWI.
The direct cause of WWI is the Sarajevo Assassination where Ferdinand, the heir of Austria-Hungary was assassinated in Sarajevo,Serbia. Austria-Hungary regarded the assassination to be an excuse to declare war on Serbia. Germany supported her action by providing a blank-cheque(unlimited support) .
Austria-Hungary then sent an ultimatum to Serbia which demand Serbia to stop all anti-Austrian propaganda and allow Austrian officials to enter Serbia and join the investigation of the assassination in 48 hours. Serbia refused to accept the latter demand. Austria-Hungary then declared war on Serbia and the opposing camps of major powers joined in shortly afterwards. By August 4, Germany, Austria-Hungary, Russia, France and Britain had all entered the war, WWI then broke out.
Hope it helps!