Read a history of the events leading up to WWI.
Those countries were forming and re-forming constantly, with political alliances all over the place. Most of them are relatively recent creations. Hell, Albania was created to be a buffer between two power centers.
And as much of a folly as was WWI, according to George Kennan it was the seminal event of the 20th century, setting up the future conflicts and Cold War.
Arf
