There is precession in Earth's orbit, hence the difference between Sidereal year and Tropical year.
Sidereal year is time for 360 degrees around Sun.
It is 31 558 149.5 seconds.
You can measure it, for example, when Earth takes the same position between Sun and, say, Bode's Galaxy (M81), at 12 million light years.
Solar year is between consequent repetition of the same orbital event, like equinox, or solstice.
On average it is 31 556 925 secons.
As you can see, the difference is 1224.5 seconds (20 min 24.5 sec).
Sidereal day is time between consequent facing of the same meridian towards the same distant star, or, for example, the same Bode's Galaxy.
It is 86 164.1 second.
Solar day is the time between consequent facing of the same meridian towards Sun.
We defined our day and hour by that.
On average it is 86400 seconds.
Additionally:
Tropical year varies due to gravitational influence of other planets.Planets and Moon wobble Earth in orbit, Jupiter even wobbles Sun.
Here is the variation of Tropical year from 1900 to 2099:
https://www.timeanddate.com/astronomy/tropicalyearlength.htmlSolar day varies plus or minus 29 seconds, depending on Earth's orbital speed variations, explained by Kepler's Second Law.
We still use Solar day to count our calendars, not Sidereal day.
That's because what synchronizes our lives is Sun, not distant stars.
(Unless our superstition makes us believe in astrology.)
So, what would be the most convenient for us:
1. Whole number of sidereal days in sidereal year?
2. Whole number of sidereal days in tropical year?
3. Whole number of solar days in sidereal year?
4. Whole number of solar days in tropical year?
The number 4, ofcourse, but we don't have either.
All we can do is count our days and organize them into our calendar years the best we can,
to follow seasonal markers (solstices and equinoxes) as close as possible.
The closest way was Gregorian calendar.
For now it is close enough.