The Black Hand conspiracy was backed by officials in the Serbian government. They approved of the assassination plot against Arch Duke Franz Ferdinand. He was the next Emperor of the Austria Hungarian Empire. They did it out of Nationalist aspirations to take Bosnia away from the Empire. The murder of the Arch Duke was clearly an act of war. Austria was not willing to fall for some nonsense about it being lone gunmen. They wanted a full scale retaliation against Serbia. Russia stuck it's nose into the affair and threatened Austria. Germany was the sworn ally of Austria and mobilized to address Russia's interference.
Due to the manner in which the various alliances were set up at the time eventually someone was going to have to put their money where the mouth is and war would have broken out. It sucks for Germany that they caught the short end of the stick, but it could just as well have been anyone due to the powder keg that had been set up.
While Austria was justifiably angry about the assassination the assassination was carried out by a private group, not the Serbian government. Austria could've just asked Serbia to cooperate in apprehending the Black Hand, and Serbia could've helped them with this covertly if the government didn't want to look antinationalist.
By demanding Serbia become a protectorate or go to war Austria essentially started World War I. Still none of the other powers were smart for getting involved, except that Britain was just trying to protect Belgian neutrality.
Austria wasn't smart about going to war. With all its ethnic divisions its a wonder the monarchy didn't realize that a war would destroy the empire. Although chances are if there wasn't World War I it would've collapsed anyways. Or it would've been the site of the first communist revolution instead of Russia.