When the liver becomes scarred (alcohol
is the most common cause) blood can't flow through it to get back to the heart
The liver normally filters the blood coming from the GI tract. The blood still has to get back to the heart so it finds alternative pathways such as the veins in the esophagus. Over time these become swollen and can erode through the esophagus and bleed.