Gourds are a Cucurbita species that grow in vines. This species include many sweet, edible plants, like large gourds.
Anas ibn Malik reported: “A tailor invited the Messenger of Allah, peace be upon him, to a meal he had prepared.” Anas said: “I went along with the Messenger of Allah, peace be upon him, to that meal. The man served barley bread and soup containing pumpkins and dried sliced meat.” He went on: “I saw the Messenger of Allah, peace be upon him, picking the pieces of pumpkin from around the dish, so I have always liked pumpkins since that day.” (Sahih Muslim, The Book of Liquid Foods)
Since pumpkins were used as bowls for food after removing their pulp, Prophet Muhammad, peace be upon him, forbade putting soaked fruits in pumpkins. Arabs, before the advent of Islam, used to keep soaked fruits (for making wine) in pumpkin bowls, as that helped brew it more quickly and strongly. When Islam arrived, all intoxicants were forbidden, and putting soaked fruits in pumpkins was forbidden, too, so their juices would not be fermented, and so is the case with varnished pots that prevent air from passing through to the beverage.