The trench is meant to collect the water that is poured upon the altar, but it also represents the demarcation of the place of the altar in God's Name. It is for this reason that the digging of the trench is mentioned immediately after erecting the altar in God's Name. The purpose of pouring water multiple times on the altar is to involve as many people as possible to make it clear that the miracle was real and not a deceit.

Courtesy of the Virtual Beit Midrash, Yeshivat Har Etzion