Early in the war, most Coastal Command aircraft were only able to detect and attack U-boats visually by day, or with a moon on clear nights.
Radar improved the situation, but night attacks were still a problem as the radar picture broke up close to the target.
The Leigh Light made it possible to keep the U-boat in sight as the range reduced, but judging height was a problem. Too low and the Depth charges could bounce, too high and they might overshoot the target.
Once the combination of radar, Leigh light and radio altimeter became available, far more night attacks were successful.