It was to do with cycles of the phases of the moon.
From excavated tally sticks, researchers have deduced that people counted days in relation to the Moon's phases as early as the Paleolithic age. Synodic months (average period of the Moon's revolution with respect to the sun) are still the basis of many calendars today.
The lunar phases vary cyclically as the Moon orbits the Earth, according to the changing relative positions of the Earth, Moon, and Sun. The time between two full moons (or between successive occurrences of the same phase) is about 29.53 days on average.
So rather than have 29 and a half days a month, they worked out 2 phases took 59 days and decided to have one month of 30 days then one of 29 days etc. This worked for everyday living, but in larger cycles became a bit higgledy-piggledy and did not fit into a year, so they created �leap days�.
The Julian reform set the lengths of the months to their modern values in the need to realign the calendar due to miscalculations during Caesars pontificate. 46 BC was the last of a series of irregular years, this extra-long year was, and is, referred to as the "last year of confusion". The first year of operation of the new calendar was 45 BC.
The Julian months were formed by adding ten days to a regular pre-Julian Roman year of 355 days, creating a regular Julian year of 365 days: Two extra days were added to Ianuarius (January) Sextilis (Augustus) and December, and one extra day was added to Aprilis, Iunius, September and November, setting the lengths of the months to the values they still hold today.