An endoscopic band ligation device is used during endoscopic procedures to treat esophageal varices by placing small elastic bands around enlarged or bleeding veins. The bands cut off blood flow to the varices, causing them to shrink and reducing the risk of bleeding.