February has fewer days than other months because it was the last month to be added to the Roman calendar, which was used in many parts of Europe for several centuries. The original Roman calendar had ten months and a total of 304 days. However, this calendar did not align with the solar year, which is approximately 365.24 days long. In order to bring the calendar in line with the solar year, the Roman ruler Julius Caesar introduced a new calendar in 45 BCE, known as the Julian calendar.
The Julian calendar had twelve months, but it still did not perfectly align with the solar year. February was the shortest month, with 28 days, and every fourth year (a "leap year"), an extra day was added to February to make up for the discrepancy. This is why leap years have 29 days in February instead of the usual 28. In 1582, the Gregorian calendar was introduced to further refine the Julian calendar, but February remained the shortest month with either 28 or 29 days depending on whether it was a leap year or not.