1 days is a rotation of earth. 1 years is an orbit of the sun. I've always beleived that one month is 1 period of the moon orbiting earth but the inconsistent distribution of days throughout the months has raised some questions. Why are months 30 or 31 days with one having 28? The orbital period of the moon is between 27 and 28 days. I know that's not a whole number but wouldn't it makes more sense to have 13 months of 28 days? Astronomically, that would be more accurately representative of the moons orbit. Why 30 and 31 days, and why 12 months?
The modern calendar is a result of various people tweaking it. At some point in Western History the months would have been linked directly to moon.
The calendars used in ancient Greece had lunar months based on observation. This creates a problem: either the year is twelve months long, and so isn't synchronized to the seasons, or you need to insert an extra month, or an inter calendar period in a rather irregular way. The Islamic calendar uses the first option (which is why Ramadan can fall during any season) The Jewish calendar chooses the second (which is why Passover is always in spring, but not on the same date)
The Romans decided to use a different solution. At some point (the exact details are vague) they decided to have months with a fixed number of days. They had 10 months, plus "winter". This was a practical farming calendar, and needed to be aligned to the year. The months were more important for the priests as certain ceremonies were carried out on particular days. The pattern of 31 and 30-day months seems to have been devised by the priests.
Later, the winter period was divided into two additional months, with leap years added (on the day before the first day of the year in the old calendar)
The advantage of this system for farmers is that you can reasonably predict when you should sow and when to harvest from the calendar. Since the months stay aligned to the year, natural annual events will occur on about the same day each year. So you can plan "we sow beans on April 20th" and you'll know the position in the year. The disadvantage, of course is that the link to the moon is broken, which is why Christmas can fall on a new moon or a full moon or anywhere in between.
In calendar systems, there are 2 types of calendars, Solar and lunar, Solar calendar has 365 days which is the orbital time around the Sun found by Kepler's 3rd law or the solar year where as lunar has 354 days, which is just 29.5 synodic month/lunation multiplied by 12 months or the lunar year.
The standard calendar is the Gregorian calendar which is solar, and that's why a month does not have 28 or 29 days (except leap February). Solar calendar is based on seasons whereas Lunar calendar is based on lunar phases, which from New Moon to Full Moon, a complete lunar cycle takes 28.5 day known as a synodic month or lunation.
The Gregorian calendar was invented by Pope Gregory XIII, which had made improvements in it's predecessor being Julian calendar, which abolished the lunar calendar. It was introduced as a standard calendar because it was accurate.
Solar calendars are accepted and helpful because they have a greater accuracy in predicting Earth's revolution, orbital time based on the distance linked by Kepler's 3rd law, it predicts the revolution accurately by 15 days than the lunar calendars henceforth it is considered better than lunar calendar which also helps farmers to farm seasonal harvests, producing greater quality crops.
Also due to the Gregorian calendar, when we refer to a year, we usually define it in the terms of a solar year rather than the phases of the moon. But I still consider Lunar calendars as good as the calendars keep changing.