Most countries became allies with neighboring countries so that they could not easily be attacked and if they were, they would have thousands of extra shoulders that would help defend them. After most of the countries had allies that only allied with other countries that were allies with them. When Franz Ferdinand, the archduke of Austria-Hungary was assassinated by Gavrilo Princip – a Serbian nationalist with ties to the secretive military group known as the Black Hand (who was from the Czech Republic,) a war started between the two, both countries, each getting support from their allies, which caused wars between other countries, and it went from there. Hope that helps :)