European countries created alliances prior to World War I to protect one another from attack. The first option is correct.
European countires such as Germany, Austria-Hungary and Italy formed the Triple Alliance. In 1882, they signed a document that promised they would give each other military support in case of a war. The Alliance agreement stated it was 'essentially defensive and conservative' with the aim of stopping anyone who 'might threaten' the three nations.
Finally, Italy still disputed land with Austria-Hungary.