The U-boat would activate a small transmitting homing beacon for other boats to travel to.
Often the trailing U-boat would be picked up by sea or air or even land based HF/DF (if close enough to land) and forced to dive, which often meant the convoy contact would be lost (especially in bad weather).
The greatest and often most under reported weapon the Allies had in their arsenal was the breaking of the Enigma code for large periods of the conflict.
The Allies became so proficient in the code that they relied heavily on aircraft to attack known U-boat positions so as to give the impression that a 'chance encounter' had happened and not as an obvious breach of Enugma.
The Kriegsmarine long suspected such a breach and carried out 3 separate internal investigations during the war.
Each time, the investigation came to the conclusion that Enigma was safe and secure for use.
Good post K-61