Principally the Imperial German Navy and the Royal Navy - both enormous forces at the time. Submarines and anti-submarine warfare were still in their infancy in WW1, but it was a German submarine that torpedoed the liner Lusitania off the coast of Ireland.
The US revolutionary war
Un-restricted submarine warfare
Serbia
The announced resumption of un-restricted submarine warfare.
unrestricted submarine warfare
Germany hoped that submarine warfare would lead to war.
By torpedoing their enemy ships: it was all they could do and were designed to do; but anti-submarine warfare was in its infancy and submarines were very hard to detect once submerged. They are even stealthier now.
Germany's submarine warfare was unrestricted. These attacks led to World War I.
unrestricted submarine warfare
Germany's unrestricted submarine warfare
inability to remain neutralGerman submarine warfare sinking lusitaniaUS economic and political ties to Great BritainZimmerman telegram
Submarine warfare has existed since the early 1900's, and continues to this day. Though the last ship sinking by a submarine was in the Falklands War, the evolving missions of submarines have taken submarine warfare well beyond just sinking ships and submarines.