Final answer:
The convoy system, involving merchant ships traveling in guarded groups, was used to protect against German U-boats during both World Wars, with great success due to advancements such as breaking the Enigma code and improved sonar and depth charges.
Step-by-step explanation:
The strategy used to protect merchant ships from German U-boats during World War I and World War II was the convoy system. This method, initially advocated by U.S. Navy Rear Admiral William S. Sims, involved merchant vessels traveling in large groups with a protective screen of destroyers and cruisers. As a result, the convoy system significantly reduced shipping losses.
Moreover, in World War II, advancements in technology and techniques, such as British codebreakers cracking the German Enigma machine at Bletchley Park combined with the improvement of sonar equipment and the use of depth charges, further enhanced the effectiveness of the convoy system against U-boat 'wolf packs.' The overall success of the convoy system along with these advancements helped the Allies to control the Atlantic Ocean and safeguard essential supply routes during these critical periods of the wars.