There were two "Happy Times" for the German U-boat fleet.
The first was in from July 1940 in the North Sea and North Atlantic after the U-boats gained access to channel ports, until around April 1941 when the British started figuring out how to effectively employ radar and direction finding to prosecute attacks on surfaced U-boats.
The second happy time was from January 1942 through August 1942 when the U-boats found easy pickings along the US east coast.
Admiral Ernest King was the head honcho in charge of defending the east coast at that time, and he should have been court martialed for gross incompetence. We lost over 600 ships, totaling 3.1 million registered tons and about 5,000 allied navy and merchant crewman in that 8 month period making it twice as large a defeat as Pearl Harbor in terms of loss of life.
He refused to implement the convoy system even though the Brits had figured out the value of convoys in WWI and reaffirmed it in action from September 1939 to December 1941
In addition to refusing to form convoys in US waters, King refused to:
- take advantage of British DF and signals intelligence indicated U-boats were in the area;
- heed British advice on counter U-boat tactics;
- order a black out along the US coast;
- properly equip available escorts with radar and DF equipment;
- use all available naval escorts;
- utilize auxiliary craft for patrol; and
- take advantage of available USAAF and Civil Air Patrol pilots and aircraft to patrol for submarines off the US coast.
Eventually Roosevelt had to intervene after Churchill flatly stated that while King was apparently comfortable losing all those ship bottoms, that was not ok with Britain as most of those bottoms were British and that unless something was done, Britain would be out of the war.
-----
In the bigger picture there were a few related factors in the Battle of the Atlantic that eventually turned the tide against Germany.
1) The U-boat fleet wasn't ready in 1939.
The original plan called for 300 U-boats on the premise that this was the number needed to keep 100 at sea at all times. (100 at sea, 100 in port being re-armed and re-provisioned and 100 undergoing maintenance and refit.) Germany could have achieved this by late 1941. Fortunately Hitler jumped the gun and started the war when the U-boat only had about 100 long range, ocean going U-boats. This only allowed about 30 at sea at any one time. Given how close they came to starving out Britain with just 30 at sea, 100 at sea would have been devastating and would have taken Britain out of the war.
2) Closing the mid Atlantic air gap.
U-boats were able to operate with more or less impunity in the mid Atlantic where they were beyond the range of patrol aircraft based in Newfoundland, Iceland and the British isles. Submarines and U-boats of the day had very limited range and speed under water and they needed to be able to operate on the surface to locate convoys and gain position to attack convoys. Patrol aircraft forced them to dive, and as such limited their mobility and ability to locate targets or converge on convoys once a U-boat located one.
By May 1943 the mid Atlantic air gap was largely closed by a combination of very long range B-24 Liberator patrol bombers, and the use of converted merchant hulls to small escort carriers that could initially accompany convoys and later form the nucleus of hunter killer groups that would track and kill U-boats.
In fact, U-boat losses rose sharply from monthly losses in the single digits to low teens, to 43 in May 1943, the highest month of the war (with the exception of April 1945 when 48 were lost). Losses fell to 16 in June, 1943 but rose to 38 again in July and U-boats were never again the threat they were in the first half of the war.
3) Improved signals intelligence.
This is separate from the later breaking of "Shark" the 4 rotor Naval version or Enigma (much more complex than the 3 rotor enigma used by the other German forces.
The British used direction finding equipment very effectively to determine where U-boats were operating. This was aided by the Kriegsmarine's insistence that U-boats report in on a daily, basis - a process that provided ample opportunity for British ships to locate the general operating areas of U-boats, often within 10-20 miles even from long range stations. This allowed the British to re-route convoys around known concentrations of U-boats.
4) Improved development and use of radar and electronic counter measures .
Radar got a lot better as the war progressed and eventually could detect a periscope or snorkel from a submerged submarine.
The Germans developed a radar detector but it was not a passive system and the British developed a system to home in on the detector, making it worse than useless.
5) Breaking Enigma.
Actually it was breaking Shark, the 4 rotor naval cipher that was the key. Lots of attention is given to capturing 4 rotor enigma machines, rotors and code keys, but the thing that really made it possible were the German weather reports. These reports followed an identical format and started with the same language each and every report. Knowing what the message started with, provided the crib that could be used to start cracking the rest of the code and with Turing's first generation computers running through the now smaller number of possible combinations, the folks at Bletchley Park could crack the codes soon enough for the information to be actionable.
6) Critical delays in getting new U-boat technology to sea.
The Type VIIC/41 and Type IXC U-boats were the backbone of the fleet, but the Germans did not pay enough attention to getting more capable boats off the drawing boards and into production and service.
Part of that was pressure to replace lost U-boats with an already mature design, part of it was allied bombing delaying production, part of it was just a short sighted approach early in the war when a short war was anticipated, and part of it as a bad decision by Albert Speer to use non ship building companies to build the Type XXI in a modular design. Great idea in theory, but while the program began in 1943, only 118 were built by the end of the war, in May 1945 and only 4 of those were ever seaworthy due to horrible quality assurance and the need for extensive post construction refits.
Had Germany managed to get a significant number of Type XXI and smaller Type XXIII U-boats at sea prior to the Normandy invasion, it's quite possible there would not have been an invasion.
---
The end result though was the loss of 765 U-boats - 3/4 of the U-boats that ever went to sea.