A common misconception is that summer happens when Earth is closer to the sun. It isn't: Earth is actually slightly closer to the sun in early January, during the Northern Hemisphere's winter. Seasons come from Earth's axis being tilted about 23.5 degrees relative to its orbit. That tilt stays pointed the same direction in space year-round, so as Earth orbits, each hemisphere leans toward the sun for part of the year and away for the other part.
When your hemisphere tilts toward the sun, sunlight strikes more directly (concentrating energy on less ground) and days are longer — that's summer. When it tilts away, light hits at a shallow angle spread over more area, and days are shorter — winter. Because the hemispheres tilt oppositely, they always have opposite seasons: it's summer in Australia during a European Christmas.
The Serbian engineer and mathematician Milutin Milanković spent decades, including years as a prisoner of war during World War I, calculating exactly how Earth's orbit and tilt change over tens of thousands of years. He showed that the axial tilt slowly varies between about 22.1 and 24.5 degrees, the orbit stretches and rounds, and the axis wobbles — and that these cycles change how sunlight is distributed across latitudes and seasons. Decades after his death, ocean-sediment records confirmed that the timing of ice ages matched his orbital cycles, cementing that the geometry of tilt and orbit, not chemistry or chance, governs Earth's long-term climate rhythms.