The immediate cause of World War I that made the aforementioned items come into play (alliances, imperialism, militarism, nationalism) was the assassination of Archduke Franz Ferdinand of Austria-Hungary. In June 1914, a Serbian-nationalist terrorist group called the Black Hand sent groups to assassinate the Archduke.
The war pitted the Central Powers—mainly Germany, Austria-Hungary, and Turkey—against the Allies—mainly France, Great Britain, Russia, Italy, Japan, and, from 1917, the United States. It ended with the defeat of the Central Powers