It was partly as a reaction to the aspiring Italian Great Power's war with the Ottomans over modern day Libya. Also it was a Serbian reaction to Austria's annexation of Bosnia which together with his overthrow of the pro-Hapsburg King a decade earlier drove him into the Russian camp and expansion to the south.
Could also say it was caused by all the unhappy Balkan (especially Bulgaria) nations following the Russo-Turkish War which was not given the full territory it wanted due to British and Austro-Hungarian opposition to any new large power in the Balkans that could oppose it's policies in Transylvania and future Yugoslavia.
The Congress of Berlin left everyone in the region unhappy and allowed the tensions and latent nationalism to simmer then boil over resulting in the Balkan Wars and WW1.