A U-boat is a type of submarine invented by the Germans for use in World War I and II. The initial "U" in U-boat stands for "unterseeboot", or undersea boat in English. Holland housed a "Submarine Development Bureau" in 1922 that was made to look like a regular shipbuilding company. The German U-boat designers had to secretly store special parts when they worked on improving their U-boats.
The Type VIIC U-boat was the main type of U-boat used in the German's U-boat campaign. The VIIC held a crew of up to 56 and 14 torpedoes. The first U-boat military campaign involved 20 U-boats. When the United Kingdom (UK) declared war on the German Empire on 4 August 1914, the Germans sent out 10 U-boats on 6 August 1914 and the remaining 10 later that month. None of the U-boats sunk any British ships, but suffered heavy German casualties.
The German's second U-boat campaign did much better, sinking 3 UK ships and killing 1,460 British sailors by 22 September 1914. The U-boats were proving their power and the Germans were sinking enemy ships faster than the British could build them. As the British had little defense against the powerful U-boats, they invented the "Q-ship" that was designed to sink U-boats. The Q-ships did work, but German skippers soon learned how to avoid the Q-ships, so the Q-ships destroyed less than 10% of all U-boats.
However, when the British merchant convoy system was introduced, it worked for the UK in successfully destroying German U-boats. British destroyer escorts (DEs) helped defeat Germany with technology such as sonar, radar, and depth charges. The U-boats had been causing serious damage in the Battle of the Atlantic until the DEs were brought in. The Battle of the Atlantic took place along the United States (US) coast as far as the Gulf of Mexico.
The cracking of the Enigma Code, known as the "German U-Boat Code", also finally helped defeat the Germans in WW II. The Enigma code was deciphered by Polish crypto-analyst/mathematician Marian Rejewski in 1933 and given to the British. The Germans used typewriter-like machines to encrypt codes into their U-boat communications.