North African Campaign: The Allied troops, mainly British, French, and American, made significant advancements in North Africa, pushing the Axis forces, primarily the German Afrika Korps led by General Erwin Rommel, towards Tunisia.
Closing the Western End: British and American forces, in coordination with local resistance movements, launched a series of attacks aimed at sealing off western Tunisia and cutting off the escape route for German troops stationed there.
Italian Surrender: In September 1943, Italy surrendered, and as a result, many Italian soldiers in North Africa stopped fighting, further weakening the Axis forces.
Lack of Supplies: The Allied forces also managed to disrupt German supply lines through naval blockades and aerial bombardment campaigns, limiting the resources available to the German troops.
Surround and Surrender: By the end of April 1943, the German forces in Tunisia found themselves surrounded on three sides by Allied troops. With supplies dwindling and escape routes blocked, they had little choice but to surrender.
In short, the Allied forces trapped German troops in Tunisia through a combination of military advances, strategic blockades, and depriving the Germans of vital resources. The German forces eventually capitulated, marking a significant turning point in the North African campaign and setting the stage for the liberation of Italy and the broader Allied advance into Europe.