Cheese is created by curdling milk by adding enzymes, usually from the stomaches of calves. After that they separate the curds from the whey. After that they press the curds, let them sit, ferment, and then they process it. That's where we get Cheese
In ancient times, liquids were often carried inside the stomach of a slaughtered animal; it could be tied off and seal the liquid inside. It is speculated that a traveler was carrying milk inside a calf's stomach which hadn't been cleaned really well and still had an enzyme in it (rennet) which caused the milk to sort of gel (as it would when the calf drank it). The man poured out some milk, or took a swig, whichever, and discovered that while the milk was no longer "fresh" neither was it "spoiled." And though he carried it the rest of the day it still didn't spoil beyond the point of being edible. Aging cheese was undoubtedly discovered later.