The simplest answer that I can give you is that the immediate cause
was the assassination of Franz Ferdinand, the archduke of
Austria-Hungary. His death at the hands of Gavrilo Princip – a Serbian
nationalist with ties to the secretive military group known as the Black
Hand – propelled the major European military powers towards war.
Hope it helped you : )