Why do we have leap years?

A leap year occurs once every four years, adding an extra day to the short month of February. Why do leap years exist?