Why do months have different numbers of days?
The modern Gregorian month lengths come from the Roman calendar, which was adjusted by Julius Caesar and refined by Pope Gregory XIII in 1582. The 30/31 alternation is broken in part by February, which was shortened to keep the year aligned with the solar cycle. See February for its variable length.