In leap year there is an additional day added to the calendar to keep the calendar year synchronized with astronomical year.
The reason adding an extra day, or leap day, to the calendar is that it takes the Earth approximately 365.2422 days to complete one orbit around the sun. Therefore, a leap year, which has 366 days instead of the usual 365, is needed every four years make up for the additional time.
However, not every year that is divisible by 4 is a leap year.A year that is divisible by 100 are not leap year unless it is also divisible by 400. For example, the year 1900 was not a leap year, but the year 2000 was a leap year because is divisible by 400. That is why next leap year after 2021 will be 2024 and after it 2028, 2032 and so on.
Leap year has an extra day in February because February is the shortest month of the year which has only 28 days, except in a leap year, when it has 29 day. The extra day is added in February to make up for the discrepancy between the calendar year and the astronomical year.
The reason of this discrepancy is that it takes the Earth slightly more than 365 day to orbit around the sun. It takes 365.2422 days. Without addition of leap day, the calendar year would gradually drift out of sync with astronomical year.
By adding a extra day to February every four years, calendar year is able to keep pace with astronomical year. This means that over the course of four year, the calendar year has accumulated an extra day in February. This helps to keep calendar year aligned with astronomical year which ensures that the seasons remain in the correct month.