Prior to WWI, powers across Europe were rapidly expanding their armies, which built a sense of distrust among the nations. Britain felt particularly threatened by Germany, as it began to rapidly expand its army. However, militarism operated alongside other WWI causes and was not solely responsible for triggering the war.
In the late 19th century, powers across Europe began rapidly expanding their armies. This became known as "the arms race." During this time, Britain built a navy that was twice as strong as France and Germany's combined, Germany attempted to expand its navy to compete, mobilization systems were developed to call men to war quickly and Germany, Russia and France developed systems with millions of reservists. As Europe was coming towards the end of a century long peace time, this made the respective powers suspicious and caused tension.
One of the most important aspects of militarism before WWI was the Anglo-German naval race. While Germany attempted to build a navy that could eclipse Britain's, Britain pushed to develop its forces to avoid this. When Germany started making progress, Britain entered the Triple Entente alliance, which was made with Russia and France. As Russia had respective alliances with other countries, its response to Austria invading Serbia in 1914 dragged Britain and France in with them.
Alongside militarism, there were other triggers for war. Nationalism was rising throughout Europe, which made countries defensive and, in some cases, willing to fight to regain territories they had lost. Imperialism also caused tensions, as countries competed to take control of African regions. Finally, there were no international organizations to mediate tensions. All of this combined, plus the assassination of Archduke Franz Ferdinand in Serbia acting as a trigger, worked alongside militarism to contribute to WWI.