Alliances were formed from these countries to their neighbors, so in the event of an attack on the other, all allies were pretty much sucked into a conflict. It was because of these alliances that pretty much every big player on the world stage was part of the war.