The apparent path of the Sun through the sky changes throughout the year due to two main factors: the tilt of Earth's axis and its orbit around the Sun.
Earth's axis is tilted relative to its orbit around the Sun. This tilt is approximately 23.5 degrees, and it remains constant throughout the year. As Earth orbits the Sun, different parts of the planet receive varying amounts of sunlight depending on their position relative to the Sun.
During the summer solstice, which occurs around June 21st in the Northern Hemisphere and December 21st in the Southern Hemisphere, one of the Earth's poles is tilted directly towards the Sun. This results in the Sun reaching its highest point in the sky, and we experience the longest day of the year in terms of daylight hours. Conversely, during the winter solstice, which occurs around December 21st in the Northern Hemisphere and June 21st in the Southern Hemisphere, one of the Earth's poles is tilted away from the Sun. This leads to the Sun's lowest point in the sky and the shortest day of the year.
During the equinoxes, which occur around March 21st and September 21st, the tilt of Earth's axis is perpendicular to the Sun-Earth line. This means that the Sun is directly above the equator, and day and night are approximately equal in length. These are known as the vernal equinox in the Northern Hemisphere and the autumnal equinox in the Southern Hemisphere.
The combined effect of Earth's axial tilt and its orbit around the Sun causes the Sun's apparent path through the sky, known as the ecliptic, to change throughout the year. It creates the seasonal variations in sunlight and the changing length of days that we experience.