Why do leap years exist?
The short answer
Earth takes slightly more than 365 days to orbit the Sun, so an extra day is added occasionally to keep the calendar aligned with seasons.
How it developed
If every year had exactly the same number of days, seasonal dates would drift over time. Leap-year rules keep the drift small.
A familiar example
Leap years are not simply every fourth year; the calendar includes exception rules.