Plate found at Ai Khanum in northern Afghanistan, in a temple, depicting Cybele, a votive sacrifice and the sun God. 2nd century BCE. (Museé Guimet, Paris) via the World History Encyclopedia. Public domain.
Combining solar and lunar calendars is tricky. The solar year is 365 days long, and includes markers for seasonal changes (solstices and equinoxes). The lunar year is 354 days long, counting 12 easily visible monthly cycles. Let's imagine some stand-in astronomer/philosopher who spends several generations of lives someplace in the Mediterranean region. Let's call her Cybele.
Cybele probably started out by noticing that the moon has a 29-30 day cycle — call those periods moonths. She knows that the solstices — the longest and shortest days of the year — happen in summer and winter seasons. But the moonths don't match this critical piece of data, so if the solstice appears in, say the sixth day of the fifth moonth this year, it slips and comes eleven days before the next year's solstice, putting it during the fourth moonth. If Cybele persists in using strictly moonth counts, she'll discover that there is a 19-year cycle before the solstices come again on the same day in the same month. But that doesn't work for day-to-day usage, so she starts adding days to the lunar calendar to get the solstice to land in the same moonth. Maybe there's an eleven day festival just before the solstice. Then maybe she decides to live with the flexible calendar for three years, then throws in an extra moonth. Eventually, Cybele figures out that in a 19-year cycle, she needs to add seven extra moonths at specific periods in the year, and voila! she's invented the metonic calendar.
Image courtesy the World History Encyclopedia