Submarines were quite important in terms of diplomacy and the course of the war. Germany hoped to use submarines in order to choke Britain away from valuable supplies. Germany realized that its own navy could never challenge British battleships for control over the shipping lanes, so it resorted to the use of the submarine instead. These submarines only submerged for attacks and spent a lot of time traveling on the surface of the water in order to allow diesel exhaust to escape. The first submarine attacks happened against solely British vessels carrying munitions or troops. In time, the British started to fly flags of neutral countries.
The German solution was to declare a war zone around the British islands. This was done openly, with ads taken out in major world newspapers. When a submarine sank the Lusitania in 1915, killing, among others, 128 Americans, the neutral United States was livid and Wilson demanded an apology. He received it and Germany backed away from unrestricted submarine warfare.
In 1917, the German general staff saw that the war of attrition was going poorly for the Germans and it was imperative to force Britain out of the war through blockade. Germany declared unrestricted submarine warfare again, sinking as many vessels as possible approaching the British Isles. The situation became so grave that merchant insurance increased considerably and Britain was actually in danger of facing shortages of food and fuel. The United States objected to these sinkings as it claimed freedom of the seas and the right to trade with whomever it wished. In April 1917, the United States went to war against the Central Powers, most notably Germany. Without the use of the submarine in WWI, Germany might not have pulled the military of the United States into the war and the conflict may have turned out much differently as the antiwar movement in the United States was quite strong until the resumption of unrestricted submarine warfare.