Over at the Bad Astronomy site, there is a very clear explanation why we have leap years. It has to do with the number of days in a year not being exactly 365 days, but about 365.25. Adding extra days over the years has an effect of syncing the calendar with actual physical years. (Remember that 1 day = one rotation of the Earth and 1 year = one orbit of the Earth around the Sun.)
The algorithm to determine if a year (in A.D., like 2008; for B.E., subtract 543 first) is a leap year is this: If the year is divisible by 400, it’s a leap year. If it’s not divisible by 400 but divisible by 100, it’s not a leap year. If it’s not divisible by 100 but divisible by 4, it’s a leap year. Other years are not a leap year.
I first heard of Bad Astronomy during my honeymoon. Aor and I went to Sydney, Australia for honeymoon. I, being a very romantic guy, went to visit Sydney bookstores with Aor in tow. I bought Phil Plait’s Bad Astronomy book and found it to be one of the best science books I read in (not so) recent years.