There is no definitive answer on this question. What there are are many theories. Fermented beverages are something that has been known since antiquity, but wine made from grapes is still a mysterious product. Some have assumed that an ancient Mediterranean shepherd forgot a bunch of grapes under the sun and that it fermented. The cluster was found there by a desperate woman who had been expelled by the sultan of a nearby harem; the woman thought that if she ate those grapes she would die … But, on the other hand, the lady not only enjoyed the sweet juice, but that back to the sultan’s palace, her appearance had recovered such vivacity and beauty that she was accepted again by the sultan in his harem.
It is possible that the grapes existed and grew even before the advent of the human being. The first news of the wine comes, perhaps, from the cultures that lived around the Caspian Sea in Antiquity, and the oldest Greeks and Egyptians already speak of it. The wine is also mentioned in the book of Genesis, when “Noah became a married man” and planted a vineyard, with disastrous results for him.
In the era before Christ, the rituals of the wine gods included devotees entering a sort of divine frenzy. The Christian saints, however, frequently rejected the frenzy of their faithful, preferring mystical ecstasy. Over time, Christian customs considered this ancient liturgy unnecessary in communion (including the custom of sharing the cup).
But the wine and the shared cup have been traits observed historically in many rituals prior to Christianity. Certainly, refusing to drink with someone with whom you were sharing a meal or a social gathering was, and still is, a kind of rebuff; declining the offer to share even a low-grade drink is a discourtesy and, of course, in the past, refusing to share any beverage could show that suspected adulteration was suspected.