If you ask anyone what a leap year is, they'll likely say it's the extra day that February gets every 4 years. While that's mostly true, the longer answer is a bit more complicated.
Dividing Up a Year
In 46 BC, Julius Caesar introduced the Julian Calendar which divided a year into days based on the approximation of a tropical year. At the time, it was known that 24-hour days did not divide evenly into a tropical year, but rather left a quarter of a day left over each time the Earth completed a full orbit.
So, even though we consider a year to be 365 days for convenience, it's technically 365.25 days long. The Julian Calendar accounted for this by adding the leap day. In this way, the extra quarter of a day could be set aside and ignored until enough quarter-days were accrued. Every 4 years, enough quarter-days are saved up to make a full day, which becomes the day added back to the calendar as February 29th.
So that's it, right?
Nope! As it turns out, it was known before the Julian Calendar that a tropical year was not 365.25 days long, but 365.2425 days long. This difference was not accounted for in the Julian Calendar, but was later acknowledged in the Gregorian Calendar introduced by Pope Gregory XIII in 1582, and is the calendar we still use today.
What does this mean for the leap year?
In regards to a leap year, every 4 years when a day is added back to the calendar, it's actually adding back more time than necessary (i.e. we're adding back 4 quarter-days instead of 0.2425days * 4years = 0.97 days).
This over-correction of 0.03 days every leap year may not seem like much, but it's nevertheless a difference that builds over time to create extra days, making the calendar lose accuracy. Thus, one final adjustment had to be made to the leap year rules.
The accepted proposal was to reduce the amount of leap years in 4 centuries from 100 to 97. This is accounted for by making every century not divisible by 400 a common year instead of a leap year, as seen with the last 4 centuries below:
- 1700 – not divisible by 400, not a leap year
- 1800 – not divisible by 400, not a leap year
- 1900 – not divisible by 400, not a leap year
- 2000 – divisible by 400, a leap year
By doing this, we get down to the necessary 97 leap years every 400 years. Now, the calendar can—rather haphazardly—average out to represent 365.2425 days a year and we get to pretend the decimals don't exist. “365 days this ye- oh, it's a leap year? 366 then!”