The "wine theory", or notion, is that folks made grape juice, and probably put it in bags (animal stomachs, not Kroger bags). The jostling and natural yeast on the grape skins will ferment the grape juice. It can go to vinegar of course, and would in anaerobic conditions, but they probably learned over time how to minimize the vinegar.
I've read that wine in Roman times was typically 5-7% alcohol, vs 12-18% today.
Beer was probably the same kind of deal. Some clever person would be trying this or that on a smaller scale to see what worked, much like steel making for swords etc.