Franz Ferdinand was an excuse to start ww1, not the cause. The declining monarchies in Germany and other countries were looking for any excuse at that time to flex their remaining muscle in the face of a world which increasingly didn’t need them.
It was the last song of monarchist expansion.
But yes, killing Franz Ferdinand was the catalyst that gave them the excuse they needed. If it hadn’t been that though, it would have been something else shortly after they would have seized on.