Almost all of the major European powers were experienced in building empires and had used their military power to conquer Asia and Africa. They were confident that their armies would be superior to those of their rivals, and they expected the war to be short. They were also very concerned about right against might and the sanctity of treaties.
Nationalism–which had been growing rapidly in many areas of the world–added fuel to the fire. It encouraged people to decide their loyalty based on their ethnic or cultural background, rather than shared interests or values. This led to tensions between Germany, Britain, and France and made it harder for them to agree on a peaceful solution. In addition, it widened the war when Austria-Hungary declared war on Serbia and Russia got involved to defend them, then Germany attacked by marching through neutral Belgium, pulling Britain into war.
The race to build larger and more powerful battleships also contributed to the war. The British designed a new type of ship, the Dreadnought, in 1902, and the Germans copied it. Then they began to redistribute their ships so that each had as many or more of the largest and most powerful ones as the other. The competition created an unstoppable timetable for each of the sides to get their forces and equipment ready for war.