Meant to ask how they kept it preserved...
Yogurt is itself a means of preserving milk. It's a step along the continuum of preserving milk in cultures that relied on sheep, goats, cows or horses.
Essentially, milk is made up of proteins, fats and water. This is a very loose generalization now - but you can preserve it by maximizing one of the available ingredients and minimizing the others. Cheese is max protein - butter is max fat. We're losing nuance here - cheese is pretty fatty and butter contains protein - but that's the general idea. You coagulate the proteins in milk to get cheese, you separate out the butter fat to get butter.
You can also dehydrate the milk, removing the water entirely, or "maximize" it by canning.
Finally - you can ferment it. Fermenting various milks in various compositions and with various cultures can give you anything from yogurt to kefir, a Mongol alcoholic drink made from mare's milk.
This is a general overview of the milk types - FAO
Now, all that said - how would the Greeks have preserved milk and milk products? In addition to maxing ingredients and fermentation, Greek cheeses in particular are notable for the addition of salt. This is a kind of maxing, itself - salt dehydrates the cheese and inhibits the growth of bacteria. It's why you'll commonly find feta packed in brine.
The subject is near and dear to my heart, now that we've got nanny goats.