Timo case ansaar was not a tribe. Ansaar was a term used to refer to both tribes and it means "hiiliyayaasha". The two tribes names were Khasraj and Ows.
Three miracles happened at that battle. 1 at a time when everyone was hungry one of the sahabis slaughtered a goat he owned and privately called the prophet and told him to come to his house and the sahabis wife told him to make sure to tell the prophet to not bring many people because it wouldnt be enough. When he invited the prophet invited evey person who digging the trenches which was about 3000 people.
When they got to the house the prophet read something to the meat and kibista and the food increased so much that everyone was able to fill his belly and by the time they left it was if it wasnt touched.
Similarly one of the wives of the sahabis sent a handful of dates to her father and her uncle who were part of the men who were digging the trenches and the prophet intercepted it and took the dates from the little girls hand. He then asked one of the sahabis to bring him a shaal and afterwards he read something to it and he threw the dates on top of the shaahl and again they increased so much until every man there ate enough.
The third miracle was while some of the sahabis were digging the trenches they came across a large rock that no human could break. The prophet broke this rock.
Yes the it was the battle of trenches and the muslims won even though there wasnt a face to face war.
And yes because they built the trenches the gaalo army could not come in medina. But that wasnt it. Allah sent a torando to them and it destroyed them until they ran back to their little villages and the sahabi who came up with the idea of digging trenches was Salman Al farsi from present day Iran.