The lives of our ancestors were governed by the cycle of night and day, the waxing and waning of the Moon and the passage of the seasons.
Thus the story of the calendar begins with astronomy, with the Earth, the Sun and the Moon. To be precise, it begins with the length of the day, the year and the lunar month, and the fact that neither the year nor the lunar month is an exact number of days, nor the year an exact number of lunar months.
The cycle of the seasons - Spring, Summer, Autumn, Winter, and Spring once more - is known to astronomers as the tropical year and it can be measured very precisely. It is 365.2421896698 days long, although it is gradually getting shorter by about half a second per century.
The lunar month is measured by the phases of the Moon - New Moon, First Quarter, Full Moon, Last Quarter, and New Moon again. It is 29.5305888531 days long, but getting longer by a little less than a fiftieth of a second per century.
There are 12.36826639275 lunar months in a tropical year.
The history of the calendar is largely about the attempts of astronomers, priests and mathematicians to force the tropical year and the lunar month to fit into a scheme comprised only of whole numbers. Like the geometers who dreamed of "squaring the circle" and the alchemists who sought to turn lead into gold, they faced an almost impossible task, but that didn't deter them.
Most ancient calendars, including those of Greece, were based upon lunar months, but in order to keep the calendar in step with the seasons, it was necessary to insert extra months now and then, because 12 lunar months are 10.8751234326 days short of a tropical year. Each of the Greek city-states kept its own calendar, however, and the insertion of the extra, or intercalary, months was left to the public authorities.
In around 432 B.C., Meton of Athens noticed that 235 lunar months were almost exactly equal to 19 tropical years (the discrepancy is about 2 hours) and proposed a 19-year cycle of intercalation. Calippus, a century later, made 940 lunar months equal to 76 years each of 365.25 days. Hipparchus, the father of modern astronomy, suggested a further cycle which made 304 years equal to 3760 lunar months and 111035 days.
The Metonic cycle again became important in the early Christian church, which tied the date of Easter to the phases of the Moon, but it is significant that although the Greeks made many profound contributions to Western culture, their calendar is not one of them.