Answer:
Long before the war began, the countries in these groups had made arrangements to work together and help one another if there was a war. So when war did break out in 1914, parts of Europe was already divided into two sides. Each of the countries involved got their troops ready to fight.